objstore

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(c Config) error

Types

type Config

type Config struct {
	Driver         string
	Bucket         string
	Region         string
	Endpoint       string
	AccessKey      string
	SecretKey      string
	ForcePathStyle bool
	BaseDir        string
	SignedURLTTL   time.Duration
}

func FromEnv

func FromEnv() Config

type ReadSeeker

type ReadSeeker interface {
	Read(p []byte) (int, error)
	Seek(offset int64, whence int) (int64, error)
}

ReadSeeker abstracts the subset we need to stream into drivers.

type Store

type Store interface {
	Put(ctx context.Context, key string, r ReadSeeker, size int64, contentType string) error
	SignedURL(ctx context.Context, key string, method string, expiry time.Duration) (string, error)
	Delete(ctx context.Context, key string) error
}

func OpenCOS

func OpenCOS(_ context.Context, c Config) (Store, error)

func OpenFile

func OpenFile(_ context.Context, c Config) (Store, error)

func OpenOSS

func OpenOSS(_ context.Context, c Config) (Store, error)

func OpenS3

func OpenS3(ctx context.Context, c Config) (Store, error)

Jump to

Keyboard shortcuts

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