Documentation
¶
Index ¶
- func NewR2StorageService(accountID, accessKeyID, accessKeySecret, bucketName string, isPublic bool) interfaces.StorageService
- func NewS3StorageService(awsRegion, accessKeyID, accessKeySecret, bucketName string, isPublic bool) interfaces.StorageService
- func NewStorageService(client aws_client.S3Client, config StorageConfig) interfaces.StorageService
- type ObjectStorageService
- func (s *ObjectStorageService) Delete(ctx context.Context, key string) error
- func (s *ObjectStorageService) Download(ctx context.Context, key string) ([]byte, error)
- func (s *ObjectStorageService) GetPublicURL(key string) string
- func (s *ObjectStorageService) Upload(ctx context.Context, key string, data []byte, contentType string) error
- type StorageConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewR2StorageService ¶
func NewR2StorageService(accountID, accessKeyID, accessKeySecret, bucketName string, isPublic bool) interfaces.StorageService
NewR2StorageService creates a StorageService configured for Cloudflare R2
func NewS3StorageService ¶
func NewS3StorageService(awsRegion, accessKeyID, accessKeySecret, bucketName string, isPublic bool) interfaces.StorageService
NewS3StorageService creates a StorageService configured for AWS S3
func NewStorageService ¶
func NewStorageService(client aws_client.S3Client, config StorageConfig) interfaces.StorageService
NewStorageService creates a new object storage service
Types ¶
type ObjectStorageService ¶
type ObjectStorageService struct {
// contains filtered or unexported fields
}
ObjectStorageService implements StorageService using S3Client
func (*ObjectStorageService) Delete ¶
func (s *ObjectStorageService) Delete(ctx context.Context, key string) error
Delete removes an object from storage
func (*ObjectStorageService) GetPublicURL ¶
func (s *ObjectStorageService) GetPublicURL(key string) string
GetPublicURL returns a public URL for the object
type StorageConfig ¶
type StorageConfig struct {
BucketName string
IsPublic bool // Whether objects should be publicly accessible
CDNDomain string // Optional CDN domain for public URLs
}
StorageConfig holds configuration for object storage
Click to show internal directories.
Click to hide internal directories.