Documentation
¶
Overview ¶
Package storage provides FileStorage implementations.
Index ¶
- type LocalStorage
- func (s *LocalStorage) Delete(_ context.Context, tenantID, storageKey string) error
- func (s *LocalStorage) Download(_ context.Context, tenantID, storageKey string) (io.ReadCloser, string, error)
- func (s *LocalStorage) Upload(_ context.Context, tenantID, filename, _ string, reader io.Reader) (string, error)
- type S3Storage
- func (s *S3Storage) Delete(ctx context.Context, tenantID, storageKey string) error
- func (s *S3Storage) Download(ctx context.Context, tenantID, storageKey string) (io.ReadCloser, string, error)
- func (s *S3Storage) Upload(ctx context.Context, tenantID, filename, contentType string, reader io.Reader) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocalStorage ¶
type LocalStorage struct {
// contains filtered or unexported fields
}
LocalStorage stores files on the local filesystem. Directory layout: {basePath}/{tenantID}/{storageKey}
Intended for development and small self-hosted deployments. For production, use S3Storage or MinIOStorage (implement the same interface).
func NewLocalStorage ¶
func NewLocalStorage(basePath string) *LocalStorage
NewLocalStorage creates a local filesystem storage provider.
func (*LocalStorage) Delete ¶
func (s *LocalStorage) Delete(_ context.Context, tenantID, storageKey string) error
func (*LocalStorage) Download ¶
func (s *LocalStorage) Download(_ context.Context, tenantID, storageKey string) (io.ReadCloser, string, error)
type S3Storage ¶
type S3Storage struct {
// contains filtered or unexported fields
}
S3Storage stores files in S3-compatible object storage (AWS S3, MinIO, etc). Object key layout: {tenantID}/{storageKey}
func NewS3Storage ¶
NewS3Storage creates an S3 storage provider. For MinIO: set endpoint to MinIO URL (e.g., "http://minio:9000"). For AWS S3: leave endpoint empty (uses default AWS endpoint).