objectstores3

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package objectstores3 provides a supported S3-compatible object storage adapter.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidConfig reports invalid S3 adapter configuration.
	ErrInvalidConfig = errors.New("invalid s3 object store config")
	// ErrStoreNotConfigured reports a nil or incomplete store.
	ErrStoreNotConfigured = errors.New("s3 object store not configured")
)

Functions

This section is empty.

Types

type Options

type Options struct {
	Endpoint            string
	Region              string
	Bucket              string
	AccessKeyID         string
	SecretAccessKey     string
	SessionToken        string
	HTTPClient          *http.Client
	Clock               func() time.Time
	MaxObjectSize       int64
	AllowedContentTypes []string
}

Options configures an S3-compatible object store.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store implements objectstore.Store using the S3 HTTP API and SigV4 signing.

func New

func New(opts Options) (*Store, error)

New creates an S3-compatible object store.

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, ref objectstore.Ref) error

Delete removes an object. Missing objects are treated as successfully deleted.

func (*Store) Get

Get reads an object. The caller owns the returned body.

func (*Store) HealthChecker

func (s *Store) HealthChecker() ports.HealthChecker

HealthChecker returns a bucket-level health checker for this store.

func (*Store) Put

func (s *Store) Put(ctx context.Context, ref objectstore.Ref, body io.Reader, opts objectstore.PutOptions) error

Put writes an object.

func (*Store) SignedURL

func (s *Store) SignedURL(ctx context.Context, ref objectstore.Ref, opts objectstore.SignedURLOptions) (string, error)

SignedURL creates a SigV4 pre-signed URL for a supported S3 object operation.

Jump to

Keyboard shortcuts

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