Documentation ¶
Index ¶
- Variables
- func Fingerprint(f fs.FileInfo) string
- func MkdirAll(fsbase FileSystem, path string, perm fs.FileMode) error
- func NewStat(name string, size int64, mode fs.FileMode, modTime time.Time, sys interface{}) fs.FileInfo
- func ReadDir(fsbase FileSystem, path string) ([]fs.DirEntry, error)
- func Walk(fsbase FileSystem, path string, walkFn fs.WalkDirFunc) error
- type File
- type FileSystem
- type Fingerprintable
- type KVEntry
- type Keyval
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Fingerprint ¶
Fingerprint will return a fingerprint for a given file, silently falling back on using size+timestamp in case of backend failure.
func Walk ¶
func Walk(fsbase FileSystem, path string, walkFn fs.WalkDirFunc) error
Walk is the equivalent of filepath.Walk
Types ¶
type FileSystem ¶
type FileSystem interface { fs.FS fs.StatFS OpenFile(path string, flag int, perm fs.FileMode) (fs.File, error) // Lstat returns the fs.FileInfo for the given path, without // following symlinks. Lstat(path string) (fs.FileInfo, error) // Mkdir creates a directory at the given path. If the directory // already exists or its parent directory does not exist or // the permissions don't allow it, an error will be returned. See // also the shorthand function MkdirAll. Mkdir(path string, perm fs.FileMode) error // Remove removes the item at the given path. If the path does // not exists or the permissions don't allow removing it or it's // a non-empty directory, an error will be returned. See also // the shorthand function RemoveAll. Remove(path string) error }
type Fingerprintable ¶
Fingerprintable is a type of object returned by Sys() that allows obtaining a string identifying a file at a current status. In case the file is modified the fingerprint should be different, and its value can be used in HTTP etag for example. If the backend storage allows it, the value should be a hash (ie. CRC32 for zipfs), and if not, size and timestamp may do.
type Keyval ¶
type Keyval interface { Get(key string) (KVEntry, error) Put(key string, value KVEntry) error Delete(key string) error // List will call callback for each entry stored in the keyval which prefix // matches. If the callback returns cont=false or err != nil, the function // will stop. // There is no guarantee entries will be listed in any order. List(prefix string, callback func(key string, value KVEntry) (cont bool, err error)) error }
Click to show internal directories.
Click to hide internal directories.