storage

package
v0.0.0-...-9531a1d Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	// Name returns the name of the backend implementation.
	Name() string

	// Reader returns a ReadCloser of the file.
	Reader(container, object string) (io.ReadCloser, error)
	// Reader returns a WriteCloser of the file.
	Writer(container, object string) (io.WriteCloser, error)
	// Copy copies a file.
	Copy(sc, so, dc, do string) error

	// FilenamesFrom list all the object names from the given prefix: `container/prefix'.
	FilenamesFrom(prefix string) ([]string, error)

	// Remove deletes the given file.
	Remove(container, object string) error
	// RemoveAll deletes all the file and folders.
	RemoveAll(path string) error
	// Cleanup cleans useless artifacts in storage.
	Cleanup() error
}

Backend is the interface that wraps the basic file operations.

func NewFileSystem

func NewFileSystem(workspace string) Backend

NewFileSystem returns a new File System backend.

Jump to

Keyboard shortcuts

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