Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotExist = errors.New("file does not exist")
ErrNotExist is returned when a stored file does not exist.
Functions ¶
This section is empty.
Types ¶
type FileStore ¶
type FileStore interface { Storer HashedStorer Exister Fetcher Iterator Remover Sizer ImgproxyURLSourcer }
A FileStore bundles all the interfaces above.
type HashedStorer ¶ added in v0.3.0
A HashedStorer stores the content of the given reader (e.g. a file) with a pre-calculated hash. The hash can be chosen freely and is not checked against the reader content.
type ImgproxyURLSourcer ¶
type ImgproxyURLSourcer interface { // ImgproxyURLSource gets the source URL to original file (e.g. for use with imgproxy). ImgproxyURLSource(hash string) (string, error) }
An ImgproxyURLSourcer can return the source URL to original file for imgproxy.
type Iterator ¶
type Iterator interface { // Iterate calls callback with a maxBatch number of asset hashes. // If callback returns an error, iteration stops and the error is returned. Iterate(ctx context.Context, maxBatch int, callback func(hashes []string) error) error }
An Iterator iterates over all stored files and returns their hashes in batches.
Click to show internal directories.
Click to hide internal directories.