storage

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const R2Region = "auto"

R2 使用 'auto' 作為預設 Region,這是連線 R2 所需的。

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*r2Config)

func WithAccessKey

func WithAccessKey(accessKey string) Option

func WithBucket

func WithBucket(bucket string) Option

func WithEndpoint

func WithEndpoint(endpoint string) Option

func WithSecretKey

func WithSecretKey(secretKey string) Option

type Storage

type Storage interface {
	Upload(ctx context.Context, key string, body io.Reader, contentType string) error
	SignedDownloadUrl(ctx context.Context, key string, expires time.Duration) (string, error)
}

func New

func New(ctx context.Context, opts ...Option) (Storage, error)

Jump to

Keyboard shortcuts

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