Documentation
¶
Index ¶
- type AzureStore
- func (a *AzureStore) Delete(ctx context.Context, bucket, key string) error
- func (a *AzureStore) Download(ctx context.Context, bucket, key string) (io.ReadCloser, error)
- func (a *AzureStore) Test(ctx context.Context) error
- func (a *AzureStore) Upload(ctx context.Context, bucket, key string, data io.Reader) error
- type BlobStore
- type CustomS3Store
- func (c *CustomS3Store) Delete(ctx context.Context, bucket, key string) error
- func (c *CustomS3Store) Download(ctx context.Context, bucket, key string) (io.ReadCloser, error)
- func (c *CustomS3Store) Test(context.Context) error
- func (c *CustomS3Store) Upload(ctx context.Context, bucket, key string, data io.Reader) error
- type DirectoryStore
- func (d *DirectoryStore) Delete(_ context.Context, bucket, key string) error
- func (d *DirectoryStore) Download(_ context.Context, bucket, key string) (io.ReadCloser, error)
- func (d *DirectoryStore) Test(_ context.Context) error
- func (d *DirectoryStore) Upload(_ context.Context, bucket, key string, data io.Reader) error
- type GCSStore
- func (g *GCSStore) Delete(ctx context.Context, bucket, key string) error
- func (g *GCSStore) Download(ctx context.Context, bucket, key string) (io.ReadCloser, error)
- func (g *GCSStore) Test(ctx context.Context) error
- func (g *GCSStore) Upload(ctx context.Context, bucket, key string, data io.Reader) error
- type S3Store
- func (s *S3Store) Delete(ctx context.Context, bucket, key string) error
- func (s *S3Store) Download(ctx context.Context, bucket, key string) (io.ReadCloser, error)
- func (s *S3Store) Test(ctx context.Context) error
- func (s *S3Store) Upload(ctx context.Context, bucket, key string, data io.Reader) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AzureStore ¶
type AzureStore struct {
// contains filtered or unexported fields
}
AzureStore implements BlobStore for Azure Blob Storage.
func NewAzureStore ¶
func NewAzureStore(config types.AzureConfig) (*AzureStore, error)
NewAzureStore creates a new Azure blob store.
func (*AzureStore) Delete ¶
func (a *AzureStore) Delete(ctx context.Context, bucket, key string) error
func (*AzureStore) Download ¶
func (a *AzureStore) Download(ctx context.Context, bucket, key string) (io.ReadCloser, error)
type BlobStore ¶
type BlobStore interface {
// Upload writes data to the given bucket and key.
Upload(ctx context.Context, bucket, key string, data io.Reader) error
// Download retrieves the object at the given bucket and key.
// The caller is responsible for closing the returned ReadCloser.
Download(ctx context.Context, bucket, key string) (io.ReadCloser, error)
// Delete removes the object at the given bucket and key.
Delete(ctx context.Context, bucket, key string) error
// Test verifies that the store is configured correctly and reachable.
Test(ctx context.Context) error
}
BlobStore provides a unified interface for cloud object storage operations. nolint:revive
func New ¶
func New(providerType types.StorageProviderType, config types.StorageConfig) (BlobStore, error)
New creates a BlobStore for the given provider type and config.
type CustomS3Store ¶
type CustomS3Store struct {
// contains filtered or unexported fields
}
CustomS3Store implements BlobStore for S3-compatible storage (MinIO, R2, etc.).
func NewCustomS3Store ¶
func NewCustomS3Store(config types.CustomS3Config) (*CustomS3Store, error)
NewCustomS3Store creates a new custom S3 blob store.
func (*CustomS3Store) Delete ¶
func (c *CustomS3Store) Delete(ctx context.Context, bucket, key string) error
func (*CustomS3Store) Download ¶
func (c *CustomS3Store) Download(ctx context.Context, bucket, key string) (io.ReadCloser, error)
type DirectoryStore ¶
type DirectoryStore struct {
// contains filtered or unexported fields
}
DirectoryStore implements BlobStore using the local filesystem. Objects are stored at <baseDir>/<bucket>/<key>.
func NewDirectoryStore ¶
func NewDirectoryStore(baseDir string) (*DirectoryStore, error)
NewDirectoryStore creates a new DirectoryStore rooted at baseDir. The directory is created if it does not exist.
func (*DirectoryStore) Delete ¶
func (d *DirectoryStore) Delete(_ context.Context, bucket, key string) error
func (*DirectoryStore) Download ¶
func (d *DirectoryStore) Download(_ context.Context, bucket, key string) (io.ReadCloser, error)
type GCSStore ¶
type GCSStore struct {
// contains filtered or unexported fields
}
GCSStore implements BlobStore for Google Cloud Storage.
func NewGCSStore ¶
NewGCSStore creates a new GCS blob store.