Documentation
¶
Overview ¶
Package s3 implements the storage contract with AWS S3 (or a compatible API such as LocalStack/MinIO).
Index ¶
- Variables
- type Config
- type S3
- func (s *S3) Delete(ctx context.Context, path string) error
- func (s *S3) DownloadURL(ctx context.Context, path string, expiry time.Duration) (string, error)
- func (s *S3) Move(ctx context.Context, src, dst string) error
- func (s *S3) UploadURL(ctx context.Context, path string, expiry time.Duration) (string, error)
Constants ¶
This section is empty.
Variables ¶
Module provides the S3 backend as the storage contract. Requires an s3.Config in the graph, supplied by the service.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Bucket string `mapstructure:"bucket"`
AwsRegion string `mapstructure:"aws_region"`
Key string `mapstructure:"key"`
Secret string `mapstructure:"secret"`
Endpoint string `mapstructure:"endpoint"`
UsePathStyle bool `mapstructure:"use_path_style"`
BaseURL string `mapstructure:"base_url"`
}
Config holds S3 connection settings. Services embed it in their config structs; the mapstructure tags live here so every service shares the same config schema.
type S3 ¶
type S3 struct {
// contains filtered or unexported fields
}
S3 is a per-region storage backend backed by AWS S3 (or a compatible API).
func New ¶
New creates an S3 backend. Uses static credentials if Key/Secret are set; otherwise falls back to the default AWS credential chain.
func (*S3) DownloadURL ¶
DownloadURL returns a presigned GET URL for direct client download from S3.