Documentation ¶
Index ¶
- type CacheDir
- func (self *CacheDir) CheckFileIntegrity(name string) (ok bool, fullpath string, err error)
- func (self *CacheDir) ComparisonFunction(f1, f2 os.FileInfo) (int, error)
- func (self *CacheDir) Delete(name string)
- func (self *CacheDir) Disable(name string)
- func (self *CacheDir) EnsureDirectory(try_create_dir bool, try_write_file bool) error
- func (self *CacheDir) GenNames(oname string) (name, name_disabled, name_sum, name_sum_disabled string)
- func (self *CacheDir) Get() (name string, data io.ReadCloser, err error)
- func (self *CacheDir) HaveCache() (bool, error)
- func (self *CacheDir) JoinFileName(filename string) string
- func (self *CacheDir) NextFile() (name string, err error)
- func (self *CacheDir) ParseWorkFileName(n string) (t time.Time, err error)
- func (self *CacheDir) ParseWorkFileNameByFileInfo(fi os.FileInfo) (t time.Time, err error)
- func (self *CacheDir) Put(data io.Reader) (err error)
- func (self *CacheDir) UnlockFile(name string)
- func (self *CacheDir) WorkingFiles() (ret []os.FileInfo, err error)
- type CacheDirOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheDir ¶
type CacheDir struct {
// contains filtered or unexported fields
}
func NewCacheDir ¶
func NewCacheDir(options *CacheDirOptions) *CacheDir
func (*CacheDir) CheckFileIntegrity ¶
func (*CacheDir) ComparisonFunction ¶
func (*CacheDir) EnsureDirectory ¶
Ensure directory acceptable to be used for file storage
func (*CacheDir) GenNames ¶
func (self *CacheDir) GenNames(oname string) (name, name_disabled, name_sum, name_sum_disabled string)
TODO: probaby, this function requires optimization oname must be suffixed with WorkExtension. it will be suffized automatically, if it's not
func (*CacheDir) Get ¶
func (self *CacheDir) Get() (name string, data io.ReadCloser, err error)
Get() locks file with returned name, so Get() can be called asyncronously and Get() will not return locked files. files can be unlocked with Unlock(), Disable() or Delete() functions
func (*CacheDir) JoinFileName ¶
preforms filepath joining of directory path and provided filename
func (*CacheDir) NextFile ¶
err = os.ErrNotExist if no any file found. acceptable filenames should be already checked by self.WorkingFiles() so NextFile() only find's the oldest one and treats any errors as not acceptable