objectstore

package
v2.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingConfigField = errors.New("objectstore: required config field missing")

ErrMissingConfigField is returned when a required Config field is empty

View Source
var ErrUnsupportedBackend = errors.New("objectstore: unsupported backend")

ErrUnsupportedBackend is returned when no registered backend can be found matching Config.Backend

Functions

func Register

func Register(p provider)

register adds a provider to the dispatch table. Called from each per-backend file's init() function. Panics on duplicate registration because that's always a build-time mistake.

Types

type AzureCredentials

type AzureCredentials struct {
}

AzureCredentials carries resolved Azure credentials.

type Backend

type Backend string

Backend selects the object-storage SDK that backs a Client.

const (
	BackendS3    Backend = "s3"
	BackendGCS   Backend = "gcs"
	BackendAzure Backend = "azure"
	BackendMem   Backend = "mem"
)

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 NewWithConfig

func NewWithConfig(cfg *Config) (*Client, error)

func (*Client) Backend

func (c *Client) Backend() Backend

func (*Client) Bucket

func (c *Client) Bucket() *blob.Bucket

func (*Client) Name

func (c *Client) Name() string

func (*Client) Shutdown

func (c *Client) Shutdown(ctx context.Context) error

func (*Client) Start

func (c *Client) Start(ctx context.Context) error

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 S3Credentials

type S3Credentials struct {
	AccessKeyID     string
	SecretAccessKey string
	SessionToken    string // optional — STS / temporary credentials
}

S3Credentials carries resolved S3 credentials.

Directories

Path Synopsis
providers
mem
s3

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL