Documentation
¶
Overview ¶
Deprecated: This package is deprecated as of 2025-10-01 and will be removed in 3 months. Please migrate to github.com/tendant/simple-content/pkg/simplecontent/storage/fs which provides:
- BlobStore interface implementation
- Better error handling
- Presigned URL support
- Git-like object key organization
See MIGRATION_FROM_LEGACY.md for migration guide.
Index ¶
- func NewFSBackend(config Config) (storage.Backend, error)
- type Config
- type FSBackend
- func (b *FSBackend) Delete(ctx context.Context, objectKey string) error
- func (b *FSBackend) Download(ctx context.Context, objectKey string) (io.ReadCloser, error)
- func (b *FSBackend) GetDownloadURL(ctx context.Context, objectKey string, downloadFilename string) (string, error)
- func (b *FSBackend) GetObjectMeta(ctx context.Context, objectKey string) (*storage.ObjectMeta, error)
- func (b *FSBackend) GetPreviewURL(ctx context.Context, objectKey string) (string, error)
- func (b *FSBackend) GetUploadURL(ctx context.Context, objectKey string) (string, error)
- func (b *FSBackend) Upload(ctx context.Context, objectKey string, reader io.Reader) error
- func (b *FSBackend) UploadWithParams(ctx context.Context, reader io.Reader, params storage.UploadParams) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
BaseDir string // Base directory for storing files
URLPrefix string // Optional URL prefix for download/upload URLs
}
Config options for the file system backend
type FSBackend ¶
type FSBackend struct {
// contains filtered or unexported fields
}
FSBackend is a file system implementation of the storage.Backend interface
func (*FSBackend) GetDownloadURL ¶
func (b *FSBackend) GetDownloadURL(ctx context.Context, objectKey string, downloadFilename string) (string, error)
GetDownloadURL returns a URL for downloading content
func (*FSBackend) GetObjectMeta ¶
func (b *FSBackend) GetObjectMeta(ctx context.Context, objectKey string) (*storage.ObjectMeta, error)
GetObjectMeta retrieves metadata for an object in the file system
func (*FSBackend) GetPreviewURL ¶
GetReviewURL returns a URL for reviewing content
func (*FSBackend) GetUploadURL ¶
GetUploadURL returns a URL for uploading content For file system, this could be a local file:// URL or an API endpoint
func (*FSBackend) UploadWithParams ¶ added in v0.0.11
Click to show internal directories.
Click to hide internal directories.