filestore

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type FileStore

type FileStore interface {
	// Peek returns the file at the given path without removing it. If the file doesn't exist, the returned error will be ErrNotFound
	// path should be formatted as "id/name". See Put for more details
	Peek(path string) ([]byte, error)
	// Get returns the file at the given path and removes it. If the file doesn't exist, the returned error will be ErrNotFound
	// path should be formatted as "id/name". See Put for more details
	Get(path string) ([]byte, error)
	// Put stores the data in a directory (physical or virtual) with a random id and the given name
	// and returns a path to the file with format id/name.
	// The path can be used by Get to retrieve the file
	Put(name string, data []byte) (string, error)
}

FileStore is an interface to temporarily store files needed by Transports

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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