s3

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package s3 is the minio-go implementation of storage.Backend. It is the only concrete backend; it talks to MinIO, AWS S3, or any S3-compatible store, differing only by Options.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

Backend is an S3-compatible object store backed by minio-go. presign is a signing-only client bound to the public endpoint; it never performs I/O, so the public host need not be reachable from the service.

func New

func New(ctx context.Context, opts Options) (*Backend, error)

New constructs the backend and ensures the target bucket exists.

func (*Backend) Delete

func (b *Backend) Delete(ctx context.Context, key string) error

func (*Backend) Get

func (b *Backend) Get(ctx context.Context, key string) (io.ReadCloser, error)

func (*Backend) GetRange

func (b *Backend) GetRange(ctx context.Context, key string, offset, length int64) (io.ReadCloser, error)

func (*Backend) List

func (b *Backend) List(ctx context.Context, fn func(storage.StoredObject) error) error

func (*Backend) PresignGet

func (b *Backend) PresignGet(ctx context.Context, key string, ttl time.Duration) (string, error)

func (*Backend) PresignPut

func (b *Backend) PresignPut(ctx context.Context, key string, ttl time.Duration) (string, error)

func (*Backend) Put

func (b *Backend) Put(ctx context.Context, key string, r io.Reader, size int64, contentType string) error

func (*Backend) Stat

func (b *Backend) Stat(ctx context.Context, key string) (storage.ObjectInfo, error)

type Options

type Options struct {
	Endpoint       string // host:port for service-side I/O, no scheme
	PublicEndpoint string // host:port for presigned URLs; empty = same as Endpoint
	Region         string
	AccessKey      string
	SecretKey      string
	Bucket         string
	UseSSL         bool
	PublicUseSSL   bool
}

Options configures the backend. It mirrors config.Storage but lives here so the storage layer never imports config (composition root maps between them).

Jump to

Keyboard shortcuts

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