Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnknownObjectStore = errors.New("unknown object store") ErrMissingSecrets = errors.New("secret provider missing") )
var ErrMissingConfigField = errors.New("objectstore: required config field missing")
ErrMissingConfigField is returned when a required Config field is empty
var ErrUnsupportedBackend = errors.New("objectstore: unsupported backend")
ErrUnsupportedBackend is returned when no registered backend can be found matching Config.Backend
Functions ¶
Types ¶
type AzureCredentials ¶
type AzureCredentials struct {
}
AzureCredentials carries resolved Azure credentials.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps a *blob.Bucket from gocloud.dev/blob plus labkit's lifecycle, observability hooks, and config metadata. Implements app.Component.
func New ¶ added in v2.25.0
New returns a Client configured from the environment, reading the infrastructure configuration from the standard config path.
Returns infrastructure.ErrNotConfigured when no ObjectStore config is present, or secret.ErrProjectionMissing when a secret projection is missing.
func NewWithConfig ¶
type Config ¶
type Config struct {
// Identity. Defaults: Name="objectstore", Namespace="gitlab",
// Subsystem="objectstore".
Name string
Namespace string
Subsystem string
// Backend selects which SDK + gocloud opener to use. Required.
Backend Backend
// Bucket name (S3/GCS) or container (Azure). Required.
Bucket string
// Region (S3 only). Required for AWS S3; informational for
// S3-compatibles when Endpoint is set.
Region string
// Endpoint (S3-compatibles only). Empty for AWS S3.
Endpoint string
// PathStyle forces path-style addressing (S3-compatibles).
PathStyle bool
// Per-backend credential structs. Only one is honoured per Backend;
// the others are ignored. nil = use the SDK's default credential
// chain (IRSA / Workload Identity / Managed Identity).
S3Credentials *S3Credentials
GCSCredentials *GCSCredentials
AzureCredentials *AzureCredentials
}
type GCSCredentials ¶
type GCSCredentials struct {
}
GCSCredentials carries resolved GCS credentials.
type Option ¶ added in v2.25.0
type Option func(*clientOptions)
Option configures a Client created via New.
func WithInfraConfig ¶ added in v2.25.0
func WithInfraConfig(c *infrastructure.Config) Option
WithInfraConfig sets the infrastructure.Config used to read infrastructure configuration and secrets. When nil, the default config is used.
type S3Credentials ¶
type S3Credentials struct {
AccessKeyID string
SecretAccessKey string
SessionToken string // optional — STS / temporary credentials
}
S3Credentials carries resolved S3 credentials.