go.bigb.es/curator
Index
- type DiskStorage
- func NewDiskStorage(root string) (*DiskStorage, error)
- func (*DiskStorage) BucketStats(_ context.Context) (objects int64, sizeBytes int64, err error)
- func (*DiskStorage) Get(_ context.Context, key string) ([]byte, string, error)
- func (*DiskStorage) Put(_ context.Context, key string, data []byte, contentType string) error
- type MemoryStorage
- func NewMemoryStorage(maxBytes int64) *MemoryStorage
- func (*MemoryStorage) BucketStats(_ context.Context) (objects int64, sizeBytes int64, err error)
- func (*MemoryStorage) Get(_ context.Context, key string) ([]byte, string, error)
- func (*MemoryStorage) Put(_ context.Context, key string, data []byte, contentType string) error
- type S3Storage
- func NewS3Storage(ctx context.Context, cfg config.S3Config) (*S3Storage, error)
- func (*S3Storage) BucketStats(ctx context.Context) (objects int64, sizeBytes int64, err error)
- func (*S3Storage) Get(ctx context.Context, key string) ([]byte, string, error)
- func (*S3Storage) Put(ctx context.Context, key string, data []byte, contentType string) error
- type StatsProvider
- type Storage
Variables
var ErrNotFound = errors.New("not found")
Types
type DiskStorage struct { // contains filtered or unexported fields }
func NewDiskStorage(root string) (*DiskStorage, error)
NewDiskStorage creates a disk-based storage under root.
func (d *DiskStorage) BucketStats(_ context.Context) (objects int64, sizeBytes int64, err error)
func (d *DiskStorage) Get(_ context.Context, key string) ([]byte, string, error)
func (d *DiskStorage) Put(_ context.Context, key string, data []byte, contentType string) error
type MemoryStorage struct { // contains filtered or unexported fields }
MemoryStorage is an in-memory storage backend for development and testing.
func NewMemoryStorage(maxBytes int64) *MemoryStorage
NewMemoryStorage creates an in-memory storage. maxBytes=0 means unlimited.
func (m *MemoryStorage) BucketStats(_ context.Context) (objects int64, sizeBytes int64, err error)
func (m *MemoryStorage) Get(_ context.Context, key string) ([]byte, string, error)
func (m *MemoryStorage) Put(_ context.Context, key string, data []byte, contentType string) error
type S3Storage struct { // contains filtered or unexported fields }
func NewS3Storage(ctx context.Context, cfg config.S3Config) (*S3Storage, error)
func (s *S3Storage) BucketStats(ctx context.Context) (objects int64, sizeBytes int64, err error)
func (s *S3Storage) Get(ctx context.Context, key string) ([]byte, string, error)
func (s *S3Storage) Put(ctx context.Context, key string, data []byte, contentType string) error
type StatsProvider interface { BucketStats(ctx context.Context) (objects int64, sizeBytes int64, err error) }
StatsProvider is optionally implemented by storage backends for metrics.
type Storage interface { Get(ctx context.Context, key string) ([]byte, string, error) // data, content-type, error Put(ctx context.Context, key string, data []byte, contentType string) error }
Storage is an optional cache for GOPROXY artifacts.
DiskStorage stores artifacts as files on the local filesystem.