Documentation ¶
Overview ¶
Package hasher implements a checksum handling overlay backend
Index ¶
- func NewFs(ctx context.Context, fsname, rpath string, cmap configmap.Mapper) (fs.Fs, error)
- type Fs
- func (f *Fs) About(ctx context.Context) (*fs.Usage, error)
- func (f *Fs) ChangeNotify(ctx context.Context, notifyFunc func(string, fs.EntryType), ...)
- func (f *Fs) CleanUp(ctx context.Context) error
- func (f *Fs) Command(ctx context.Context, name string, arg []string, opt map[string]string) (out interface{}, err error)
- func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, error)
- func (f *Fs) DirCacheFlush()
- func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string) error
- func (f *Fs) Disconnect(ctx context.Context) error
- func (f *Fs) Features() *fs.Features
- func (f *Fs) Hashes() hash.Set
- func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err error)
- func (f *Fs) ListR(ctx context.Context, dir string, callback fs.ListRCallback) (err error)
- func (f *Fs) MergeDirs(ctx context.Context, dirs []fs.Directory) error
- func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object, error)
- func (f *Fs) Name() string
- func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error)
- func (f *Fs) PublicLink(ctx context.Context, remote string, expire fs.Duration, unlink bool) (string, error)
- func (f *Fs) Purge(ctx context.Context, dir string) error
- func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
- func (f *Fs) PutStream(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
- func (f *Fs) PutUnchecked(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
- func (f *Fs) Root() string
- func (f *Fs) SetWrapper(wrapper fs.Fs)
- func (f *Fs) Shutdown(ctx context.Context) (err error)
- func (f *Fs) String() string
- func (f *Fs) UnWrap() fs.Fs
- func (f *Fs) UserInfo(ctx context.Context) (map[string]string, error)
- func (f *Fs) WrapFs() fs.Fs
- type Object
- func (o *Object) Fs() fs.Info
- func (o *Object) GetTier() string
- func (o *Object) Hash(ctx context.Context, hashType hash.Type) (hashVal string, err error)
- func (o *Object) ID() string
- func (o *Object) Metadata(ctx context.Context) (fs.Metadata, error)
- func (o *Object) MimeType(ctx context.Context) string
- func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (r io.ReadCloser, err error)
- func (o *Object) Remove(ctx context.Context) error
- func (o *Object) SetModTime(ctx context.Context, mtime time.Time) error
- func (o *Object) SetTier(tier string) error
- func (o *Object) String() string
- func (o *Object) UnWrap() fs.Object
- func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Fs ¶
Fs represents a wrapped fs.Fs
func (*Fs) ChangeNotify ¶
func (f *Fs) ChangeNotify(ctx context.Context, notifyFunc func(string, fs.EntryType), pollIntervalChan <-chan time.Duration)
ChangeNotify calls the passed function with a path that has had changes.
func (*Fs) Command ¶
func (f *Fs) Command(ctx context.Context, name string, arg []string, opt map[string]string) (out interface{}, err error)
Command the backend to run a named command
The command run is name args may be used to read arguments from opts may be used to read optional arguments from
The result should be capable of being JSON encoded If it is a string or a []string it will be shown to the user otherwise it will be JSON encoded and shown to the user like that
func (*Fs) DirCacheFlush ¶
func (f *Fs) DirCacheFlush()
DirCacheFlush resets the directory cache - used in testing as an optional interface
func (*Fs) DirMove ¶
DirMove moves src, srcRemote to this remote at dstRemote using server-side move operations.
func (*Fs) Disconnect ¶
Disconnect the current user
func (*Fs) MergeDirs ¶
MergeDirs merges the contents of all the directories passed in into the first one and rmdirs the other directories.
func (*Fs) PublicLink ¶
func (f *Fs) PublicLink(ctx context.Context, remote string, expire fs.Duration, unlink bool) (string, error)
PublicLink generates a public link to the remote path (usually readable by anyone)
func (*Fs) Put ¶
func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
Put data into the remote path with given modTime and size
func (*Fs) PutStream ¶
func (f *Fs) PutStream(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
PutStream uploads to the remote path with undeterminate size.
func (*Fs) PutUnchecked ¶
func (f *Fs) PutUnchecked(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
PutUnchecked uploads the object, allowing duplicates.
func (*Fs) SetWrapper ¶
SetWrapper sets the Fs that is wrapping this Fs
func (*Fs) Shutdown ¶
Shutdown the backend, closing any background tasks and any cached connections.
func (*Fs) String ¶
String returns a description of the FS The "hasher::" prefix is a distinctive feature.
type Object ¶
Object represents a composite file wrapping one or more data chunks
func (*Object) Metadata ¶ added in v1.59.1
Metadata returns metadata for an object
It should return nil if there is no Metadata
func (*Object) Open ¶
func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (r io.ReadCloser, err error)
Open opens the file for read. Full reads will also update object hashes.
func (*Object) SetModTime ¶
SetModTime sets the modification time of the file. Also prunes the cache entry when modtime changes so that touching a file will trigger checksum recalculation even on backends that don't provide modTime with fingerprint.
type Options ¶
type Options struct { Remote string `config:"remote"` Hashes fs.CommaSepList `config:"hashes"` AutoSize fs.SizeSuffix `config:"auto_size"` MaxAge fs.Duration `config:"max_age"` }
Options defines the configuration for this backend