storage

package
v0.0.0-...-15f65a9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrObjectNotFound = errors.New("object not found")
)

Functions

This section is empty.

Types

type GetObjectOptions

type GetObjectOptions struct {
	IfUnModifiedSince time.Time
}

type MemoryConfig

type MemoryConfig struct {
	Logger logging.Logger
}

type S3Config

type S3Config struct {
	S3URL             string
	S3Bucket          string
	S3AccessKeyId     string
	S3AccessKeySecret string
	Logger            logging.Logger
}

type Storage

type Storage interface {
	// PutObject  stores the object data for the given key
	PutObject(ctx context.Context, key string, object []byte) error

	// GetObject returns the object data for the given key
	GetObject(ctx context.Context, key string) ([]byte, bool, error)

	// ListObjects returns a list of object keys that match the given prefix
	ListObjectKeys(ctx context.Context, prefix string) ([]string, error)

	// Key returns the object key for the given shard and version
	Key(shard string, dekID string) string

	// Latest returns the object key for the latest version of the given workspace
	Latest(shard string) string
}

func NewMemory

func NewMemory(config MemoryConfig) (Storage, error)

func NewS3

func NewS3(config S3Config) (Storage, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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