filestore

package
v0.45.4-rc3 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 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 Deleter

type Deleter interface {
	// Delete deletes a file object at the given path.
	Delete(ctx context.Context, path string) error
}

type Getter

type Getter interface {
	// Get returns bytes content of file object at the given path.
	Get(ctx context.Context, path string) ([]byte, error)

	// GetReader returns a new Reader to read the contents of the object.
	// The caller must call Close on the returned Reader when done reading.
	GetReader(ctx context.Context, path string) (io.ReadCloser, error)
}

type Lister

type Lister interface {
	// List finds all objects in storage where its path starts with the given prefix
	// and returns objects' attributes (without content).
	List(ctx context.Context, prefix string) ([]ObjectAttrs, error)
}

type ObjectAttrs

type ObjectAttrs struct {
	Path      string
	Size      int64
	Etag      string
	UpdatedAt int64
}

type Putter

type Putter interface {
	// Put uploads a file object to store at the given path.
	Put(ctx context.Context, path string, content []byte) error
}

type Store

type Store interface {
	Getter
	Putter
	Deleter
	Lister
	Closer
}

Directories

Path Synopsis
Package filestoretest is a generated GoMock package.
Package filestoretest is a generated GoMock package.

Jump to

Keyboard shortcuts

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