blob

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultFSRoot    = ".saiki"
	DefaultCloudRoot = ""
)

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, opts ...OptionFunc) (*Backend, error)

func NewFromEnv

func NewFromEnv(ctx context.Context) (*Backend, error)

func (*Backend) Close

func (b *Backend) Close(ctx context.Context) error

func (*Backend) Create

func (b *Backend) Create(ctx context.Context, name string) (io.WriteCloser, error)

func (*Backend) Open

func (b *Backend) Open(ctx context.Context, name string) (io.ReadCloser, error)

func (*Backend) Provider

func (b *Backend) Provider() string

func (*Backend) ReadDir

func (b *Backend) ReadDir(ctx context.Context, path string) ([]os.FileInfo, error)

func (*Backend) Remove

func (b *Backend) Remove(ctx context.Context, key string) error

func (*Backend) RemoveAll

func (b *Backend) RemoveAll(ctx context.Context, keys []string) ([]string, error)

func (*Backend) Root

func (b *Backend) Root() string

func (*Backend) Walk

func (b *Backend) Walk(ctx context.Context, root string, walkFn filepath.WalkFunc) error

type Config

type Config struct {
	BucketName string
	Root       string
	S3         *aws.Config
	Mem        *memblob.Options
	FS         *fileblob.Options
}

func ConfigFromEnv

func ConfigFromEnv(provider Provider) Config

type FileInfo

type FileInfo struct {
	*blob.ListObject
}

func (*FileInfo) IsDir

func (f *FileInfo) IsDir() bool

func (*FileInfo) ModTime

func (f *FileInfo) ModTime() time.Time

func (*FileInfo) Mode

func (f *FileInfo) Mode() os.FileMode

func (*FileInfo) Name

func (f *FileInfo) Name() string

func (*FileInfo) Size

func (f *FileInfo) Size() int64

func (*FileInfo) Sys

func (f *FileInfo) Sys() interface{}

type OptionFunc

type OptionFunc func(*Backend)

func WithConfig

func WithConfig(config Config) OptionFunc

func WithProvider

func WithProvider(provider Provider) OptionFunc

type Provider

type Provider string
const (
	S3Provider  Provider = "S3"
	MemProvider Provider = "memory"
	FSProvider  Provider = "filesystem"
)

Jump to

Keyboard shortcuts

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