Documentation
¶
Index ¶
- Constants
- func NewCloudStorage(c context.Context, encoder ports.CipherEncoder) (ports.Storage, error)
- func NewLocalStorage(ctx context.Context) ports.Storage
- func NewStorageFromConfig(storageType string, appData map[string]string, encoder ports.CipherEncoder) (ports.Storage, error)
- type CloudStorage
- type ContextStorage
- type LocalStorage
- type Resolver
- type Type
Constants ¶
View Source
const ( Context = ContextStorage("storage") // Cloud Specific const CloudType = "cloud_type" BucketName = "bucket_name" Prefix = "prefix" Custom = "custom" AccessId = "access_id" SecretKey = "secret_key" Endpoint = "endpoint" Region = "region" InitBucket = "init_bucket" LocalStorageType Type = "LocalStorage" SecureLocation = "secure_location" // Auth CloudKey = "AWS_ACCESS_KEY" // #nosec G101 CloudSecret = "AWS_SECRET_KEY" // #nosec G101 )
Variables ¶
This section is empty.
Functions ¶
func NewCloudStorage ¶
NewCloudStorage creates a CloudStorage instance using context‑provided config. It validates context, parses app data, supports custom S3 endpoints or native cloud URLs, initializes the bucket (creating it if requested), and returns a configured Storage.
func NewStorageFromConfig ¶
Types ¶
type CloudStorage ¶
type CloudStorage struct {
BucketRef *blob.Bucket
BucketName string
Prefix string
StorageName string
}
func (*CloudStorage) FindAllFiles ¶
func (s *CloudStorage) FindAllFiles(folder string, fullPath bool) ([]string, error)
func (*CloudStorage) GetPrefix ¶
func (s *CloudStorage) GetPrefix() string
func (*CloudStorage) Name ¶
func (s *CloudStorage) Name() string
type ContextStorage ¶
type ContextStorage string
type LocalStorage ¶
type LocalStorage struct {
// contains filtered or unexported fields
}
LocalStorage default storage engine
func (*LocalStorage) FindAllFiles ¶
func (s *LocalStorage) FindAllFiles(folder string, fullPath bool) ([]string, error)
func (*LocalStorage) GetPrefix ¶
func (s *LocalStorage) GetPrefix() string
GetPrefix should always return "" for local storage
func (*LocalStorage) Name ¶
func (s *LocalStorage) Name() string
Click to show internal directories.
Click to hide internal directories.