Documentation
¶
Index ¶
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 implements the Storage interface for local file storage
func NewLocalStorage ¶
func NewLocalStorage(baseDir string, urlPathPrefix string) *LocalStorage
NewLocalStorage creates a new local file storage rooted at baseDir and served under the given URL path prefix (e.g. "/uploads/media/")
func (*LocalStorage) Delete ¶
func (s *LocalStorage) Delete(filePath string) error
Delete deletes a file from the local storage. If filePath is relative, it is resolved against baseDir.
func (*LocalStorage) GetURL ¶
func (s *LocalStorage) GetURL(filePath string) string
GetURL returns the relative URL path for a file. Local uploads are always served by this same process (the /uploads/ file server is mounted only when the local driver is active), so a root-relative URL keeps working behind reverse proxies and HTTPS without baking host/port into stored data.
type S3Options ¶
type S3Options struct {
Endpoint string
Region string
Bucket string
AccessKeyID string
SecretAccessKey string
UsePathStyle bool
PublicBaseURL string
KeyPrefix string
HTTPClient *http.Client
Retryer aws.Retryer
}
S3Options holds the configuration for an S3-compatible storage backend. AWS S3 and MinIO both speak the S3 API — the same client serves either: leave Endpoint empty for AWS, or set it (e.g. "http://minio:9000") for MinIO.
type S3Storage ¶
type S3Storage struct {
// contains filtered or unexported fields
}
S3Storage implements the Storage interface for S3-compatible object storage
func NewS3Storage ¶
NewS3Storage creates an S3-compatible storage backend (AWS S3 or MinIO)