storage

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Region        string
	AccessKey     string
	SecretKey     string
	MinioEndpoint string
	LocalRootDir  string
	Bucket        string
}

Options for object storage.

type Storage

type Storage interface {
	// Upload uploads a file to an object storage.
	Upload(ctx context.Context, bucket, key string, file io.Reader) error
	// Download downloads a file from a remote object storage location.
	Download(ctx context.Context, bucket, key string, file io.Writer) error
	// MakeBucket creates a new bucket.
	MakeBucket(ctx context.Context, bucket, location string) error
	// Exists checks whether an object exists.
	Exists(ctx context.Context, bucket, key string) (bool, error)
}

Storage abstract uploading and download files from different object storage solutions.

func New

func New(kind string, opts Options) (Storage, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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