Documentation
¶
Index ¶
- Constants
- 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) CreateCache() (*os.File, error)
- func (self *CacheDir) CreateSumForCache(name string, signal bool) error
- func (self *CacheDir) Delete(name string)
- func (self *CacheDir) Disable(name string)
- func (self *CacheDir) Enable(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) GetServerNewItemSignalChan() <-chan EmptyStruct
- func (self *CacheDir) GetServerThreadWorker() goworker.WorkerI
- func (self *CacheDir) HaveCache() (bool, error)
- func (self *CacheDir) JoinFileName(filename string) string
- func (self *CacheDir) MakeSignalIfSocketEnabled() error
- func (self *CacheDir) NewNameForCache() 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
- type EmptyStruct
Constants ¶
const TXT_SERVER_SIDE_UNIX_SOCKET = "Server Side UNIX Socket"
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) CreateSumForCache ¶
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 may be suffixed with WorkExtension. it will be suffized automatically, if it isn't this function strips path from oname and uses only oname Base resulting values are joined with path, so they are full path names
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) GetServerNewItemSignalChan ¶
func (self *CacheDir) GetServerNewItemSignalChan() <-chan EmptyStruct
func (*CacheDir) GetServerThreadWorker ¶
func (*CacheDir) JoinFileName ¶
preforms filepath joining of directory path and provided filename
func (*CacheDir) MakeSignalIfSocketEnabled ¶
func (*CacheDir) NewNameForCache ¶
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
func (*CacheDir) ParseWorkFileName ¶
func (*CacheDir) ParseWorkFileNameByFileInfo ¶
func (*CacheDir) UnlockFile ¶
type CacheDirOptions ¶
type EmptyStruct ¶
type EmptyStruct struct{}