Documentation
¶
Overview ¶
Package s3client provides shared S3 connection configuration and minio client construction.
A single Config block is declared in the global configuration and a ClientProvider lazily constructs a singleton *minio.Client that can be shared across multiple consumers (cache backends, strategies, etc.).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
NewClient constructs a *minio.Client from the given Config. The standard AWS credential chain is used:
- Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN)
- AWS credentials file (~/.aws/credentials)
- IAM role from EC2 instance metadata or ECS container credentials
Types ¶
type ClientProvider ¶
ClientProvider is a function that lazily creates a singleton *minio.Client.
func NewClientProvider ¶
func NewClientProvider(ctx context.Context, config Config) ClientProvider
NewClientProvider returns a ClientProvider that will construct the minio client at most once using the supplied Config.
type Config ¶
type Config struct {
Endpoint string `hcl:"endpoint,optional" help:"S3 endpoint URL (e.g., s3.amazonaws.com or localhost:9000)." default:"s3.amazonaws.com"`
Region string `hcl:"region,optional" help:"S3 region." default:"us-west-2"`
UseSSL bool `hcl:"use-ssl,optional" help:"Use SSL for S3 connections." default:"true"`
SkipSSLVerify bool `hcl:"skip-ssl-verify,optional" help:"Skip SSL certificate verification." default:"false"`
}
Config holds S3 connection parameters that are shared across all consumers. It is intended to be embedded as a global HCL block (e.g. `hcl:"s3,block"`).
Directories
¶
| Path | Synopsis |
|---|---|
|
Package s3clienttest provides a reusable MinIO test server via Docker.
|
Package s3clienttest provides a reusable MinIO test server via Docker. |