Documentation ¶
Overview ¶
Package cache implements the Fs cache
Index ¶
- Variables
- func Canonicalize(fsString string) string
- func Clear()
- func ClearConfig(name string) (deleted int)
- func ClearMappings()
- func ClearMappingsPrefix(prefix string) (deleted int)
- func Entries() int
- func EntriesWithPinCount() (pinned, unpinned int)
- func Get(ctx context.Context, fsString string) (f fs.Fs, err error)
- func GetArr(ctx context.Context, fsStrings []string) (f []fs.Fs, err error)
- func GetFn(ctx context.Context, fsString string, ...) (f fs.Fs, err error)
- func Pin(f fs.Fs)
- func PinUntilFinalized(f fs.Fs, x interface{})
- func Put(fsString string, f fs.Fs)
- func PutErr(fsString string, f fs.Fs, err error)
- func Unpin(f fs.Fs)
Constants ¶
This section is empty.
Variables ¶
var ( // JobGetJobID for internal use only JobGetJobID func(context.Context) (int64, bool) // JobOnFinish for internal use only JobOnFinish func(int64, func()) (func(), error) )
To avoid circular dependencies these are filled in by fs/rc/jobs/job.go
Functions ¶
func Canonicalize ¶
Canonicalize looks up fsString in the mapping from user supplied names to canonical names and return the canonical form
func ClearConfig ¶
ClearConfig deletes all entries which were based on the config name passed in
Returns number of entries deleted
func ClearMappings ¶
func ClearMappings()
ClearMappings removes everything from remap and childParentMap
func ClearMappingsPrefix ¶
ClearMappingsPrefix deletes all mappings to parents with given prefix
Returns number of entries deleted
func EntriesWithPinCount ¶
func EntriesWithPinCount() (pinned, unpinned int)
EntriesWithPinCount returns the number of pinned and unpinned entries in the cache
Each entry is counted only once, regardless of entry.pinCount
func GetFn ¶
func GetFn(ctx context.Context, fsString string, create func(ctx context.Context, fsString string) (fs.Fs, error)) (f fs.Fs, err error)
GetFn gets an fs.Fs named fsString either from the cache or creates it afresh with the create function
func PinUntilFinalized ¶
PinUntilFinalized pins f into the cache until x is garbage collected
This calls runtime.SetFinalizer on x so it shouldn't have a finalizer already.
Types ¶
This section is empty.