s3

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package s3 provides a dependency-free S3-compatible object backend.

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
}

func New

func New(config Config) (*Backend, error)

func (*Backend) Delete

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

func (*Backend) List

func (backend *Backend) List(ctx context.Context, list storage.ListRequest) (storage.ListPage, error)

func (*Backend) Open

func (backend *Backend) Open(ctx context.Context, key string) (io.ReadCloser, storage.Object, error)

func (*Backend) Ping

func (backend *Backend) Ping(ctx context.Context) error

Ping verifies bucket reachability and credentials without listing or mutating application objects.

func (*Backend) Put

func (backend *Backend) Put(ctx context.Context, key string, source io.Reader, size int64, contentType string) (result error)

func (*Backend) SignedURL

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

type Config

type Config struct {
	Endpoint, Region, Bucket, AccessKey, SecretKey string
	Client                                         *http.Client
	// AllowInsecureEndpoint explicitly permits plaintext HTTP for local S3
	// emulators such as MinIO. Production credentials must use HTTPS.
	AllowInsecureEndpoint bool
	// MaxSpoolBytes bounds temporary disk use when Put receives a reader that
	// cannot be rewound for signing. Zero selects the Ridu upload limit.
	MaxSpoolBytes int64
	// SpoolDirectory optionally selects the directory for non-seekable Put
	// payloads. The operating system temporary directory is used by default.
	SpoolDirectory string
}

Jump to

Keyboard shortcuts

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