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.
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 overrides the backend's default service URL. Used for
// S3-compatibles and for GCS emulators / custom GCS endpoints. Empty
// for AWS S3 and for production GCS.
Endpoint string
// PathStyle forces path-style addressing (S3-compatibles).
PathStyle bool
// UniverseDomain selects a non-default GCS universe domain (sovereign
// / Trusted Partner Cloud, e.g. "apis.gov"). Empty uses the default
// googleapis.com universe.
UniverseDomain string
// 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 {
// JSON is the raw service-account key JSON. When empty (or
// GCSCredentials is nil), the GCS SDK falls back to Application
// Default Credentials (Workload Identity / metadata server /
// GOOGLE_APPLICATION_CREDENTIALS).
JSON []byte
}
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.