bucket

package
v0.23.3 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoBucket = errors.New("no bucket configuration")
)

Functions

This section is empty.

Types

type Bucket

type Bucket interface {
	List(time.Time) (chan *Object, error)
	ObjectURL(string) *url.URL
	IsLocal() bool
}

func Open

func Open(config Config) (Bucket, error)

func OpenAll

func OpenAll(buckets []Config) ([]Bucket, error)

func OpenMedia

func OpenMedia(buckets []Config, mediaType string) ([]Bucket, error)

type Config

type Config struct {
	Media        string
	RewriteRules []RewriteRule
	S3           S3Config
	FS           FSConfig
	Local        bool
}

type FSConfig added in v0.14.0

type FSConfig struct {
	Root string
}

type Object

type Object struct {
	Key          string
	Path         string // Key modified by rewrite rules
	ETag         string
	Size         int64
	LastModified time.Time
}

type RewriteRule

type RewriteRule struct {
	Pattern string
	Replace string
}

type S3Config added in v0.14.0

type S3Config struct {
	Endpoint        string
	Region          string
	AccessKeyID     string
	SecretAccessKey string
	BucketName      string
	ObjectPrefix    string
	URLExpiration   time.Duration
}

Jump to

Keyboard shortcuts

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