storage

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultOperationTimeout = 3 * time.Minute

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage interface {
	// Get writes contents of the given object with given key from remote storage to io.Writer.
	Get(p string, w io.Writer) error

	// Put writes contents of io.Reader to remote storage at given key location.
	Put(p string, r io.Reader) error

	// Exists checks if object with given key exists in remote storage.
	Exists(p string) (bool, error)

	// List lists contents of the given directory by given key from remote storage.
	List(p string) ([]backend.FileEntry, error)

	// Delete deletes the object from remote storage.
	Delete(p string) error
}

Storage is a place that files can be written to and read from.

func New

func New(l log.Logger, b backend.Backend, timeout time.Duration) Storage

New create a new default storage.

Directories

Path Synopsis
gcs
s3

Jump to

Keyboard shortcuts

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