storage

package
v0.0.0-...-167e338 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func GetRootCAs

func GetRootCAs() *x509.CertPool

func SettingsFromContext

func SettingsFromContext(ctx context.Context) (*model.StorageSettings, bool)

func SettingsWithContext

func SettingsWithContext(ctx context.Context, set *model.StorageSettings) context.Context

Types

type ObjectInfo

type ObjectInfo struct {
	Path string

	Size *int64

	LastModified *time.Time
}

type ObjectReader

type ObjectReader interface {
	io.Reader

	Length() int64
}

type ObjectStorage

type ObjectStorage interface {
	HealthCheck(ctx context.Context) error
	GetObject(ctx context.Context, path string) (io.ReadCloser, error)
	PutObject(ctx context.Context, path string, src io.Reader) error
	DeleteObject(ctx context.Context, path string) error
	StatObject(ctx context.Context, path string) (*ObjectInfo, error)

	// The following interface generates signed URLs.
	GetRequest(ctx context.Context, path string, filename string,
		duration time.Duration) (*model.Link, error)
	DeleteRequest(ctx context.Context, path string,
		duration time.Duration) (*model.Link, error)
	PutRequest(ctx context.Context, path string,
		duration time.Duration) (*model.Link, error)
}

ObjectStorage allows to store and manage large files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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