Documentation ¶
Index ¶
- Constants
- type Cache
- func (self *Cache) Chtime(ino uint64, mtime time.Time) (err error)
- func (self *Cache) Close(ino uint64) (err error)
- func (self *Cache) CloseCache() (err error)
- func (self *Cache) ListCache() (paths []string)
- func (self *Cache) Make(ino uint64, dir bool) (err error)
- func (self *Cache) Open(path string) (ino uint64, err error)
- func (self *Cache) ReadAt(ino uint64, buf []byte, off int64) (n int, err error)
- func (self *Cache) Readdir(ino uint64, maxcount int) (infos []objio.ObjectInfo, err error)
- func (self *Cache) Remove(ino uint64, dir bool) (err error)
- func (self *Cache) Rename(ino uint64, newpath string) (err error)
- func (self *Cache) ResetCache(progress func(path string)) (err error)
- func (self *Cache) Stat(ino uint64) (info objio.ObjectInfo, err error)
- func (self *Cache) Statfs() (info objio.StorageInfo, err error)
- func (self *Cache) Storage() objio.ObjectStorage
- func (self *Cache) Sync(ino uint64) (err error)
- func (self *Cache) Truncate(ino uint64, size int64) (err error)
- func (self *Cache) WriteAt(ino uint64, buf []byte, off int64) (n int, err error)
- type Config
Constants ¶
View Source
const ( DefaultDirPathTimeout = time.Second * 10 DefaultDirPathMaxCount = 100 DefaultNegPathTimeout = time.Second * 3 DefaultNegPathMaxCount = 100 DefaultLoopPeriod = time.Second * 10 DefaultUploadDelay = DefaultLoopPeriod DefaultEvictDelay = DefaultLoopPeriod * 3 )
View Source
const ( OpenIfExists = 0 Open = 1 Activate = 2 )
View Source
const Version = 1 // bump version when database format changes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) CloseCache ¶
func (*Cache) ResetCache ¶
func (*Cache) Storage ¶
func (self *Cache) Storage() objio.ObjectStorage
type Config ¶
type Config struct { // DirPathTimeout is the duration that Readdir will be satisfied from cache. // This value should be less than EvictDelay. DirPathTimeout time.Duration // DirPathMaxCount is the maximum count of directories cached. DirPathMaxCount int // NegPathTimeout is the duration that a negative lookup (ENOENT) is considered valid. NegPathTimeout time.Duration // NegPathMaxCount is the maximum count of negative lookups cached. NegPathMaxCount int // LoopPeriod is how often the background thread will run to upload and evict files. LoopPeriod time.Duration // UploadDelay is how long the background thread will wait before uploading a file. UploadDelay time.Duration // UploadDelay is how long the background thread will wait before evicting a file. EvictDelay time.Duration }
Click to show internal directories.
Click to hide internal directories.