filestore

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Closer

type Closer interface {
	Close() error
}

type Getter

type Getter interface {
	// GetObject retrieves the content of a specific object in file storage bucket at path.
	GetObject(ctx context.Context, path string) (Object, error)
}

type Lister

type Lister interface {
	// ListObjects list all objects in file storage bucket at prefix.
	// The returned objects only contain the path to the object without object content.
	ListObjects(ctx context.Context, prefix string) ([]Object, error)
}

type Object

type Object struct {
	Path    string
	Size    int64
	Content []byte
}

type Putter

type Putter interface {
	// PutObject upload an object content to file storage at path.
	PutObject(ctx context.Context, path string, content []byte) error
}

type Store

type Store interface {
	Getter
	Putter
	Lister
	Closer
	NewReader(ctx context.Context, path string) (io.ReadCloser, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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