Documentation ¶
Index ¶
- type CacheInterface
- type CacheItem
- type ObservingFileCache
- type StupidFileCache
- func (cache *StupidFileCache) Close()
- func (cache *StupidFileCache) Free() uint
- func (cache *StupidFileCache) Get(filename string) (value []byte, e error)
- func (cache *StupidFileCache) GetMaxFiles() uint
- func (cache *StupidFileCache) GetMaxSize() uint
- func (cache *StupidFileCache) GetSize() uint
- func (cache *StupidFileCache) GetString(filename string) (string, error)
- func (cache *StupidFileCache) Remove(filename string)
- func (cache *StupidFileCache) Reset()
- func (cache *StupidFileCache) SetMaxFiles(to uint)
- func (cache *StupidFileCache) SetMaxSize(to uint)
- type StupidInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheInterface ¶
type ObservingFileCache ¶
type ObservingFileCache struct { StupidFileCache // contains filtered or unexported fields }
* uses inotify to detect changes made to the cached files * and if so update the cache * * TODO * add error handling * add support for optional inotify delete
func NewObservingFileCache ¶
func NewObservingFileCache() (cache *ObservingFileCache)
func NewObservingFileCacheMaxSize ¶
func NewObservingFileCacheMaxSize(maxSize uint) (cache *ObservingFileCache)
func (*ObservingFileCache) Get ¶
func (cache *ObservingFileCache) Get(filename string) (value []byte, e error)
func (*ObservingFileCache) Remove ¶
func (cache *ObservingFileCache) Remove(filename string)
remove from cache; stop watching goroutines.
func (*ObservingFileCache) Reset ¶
func (cache *ObservingFileCache) Reset()
remove all files from cache
type StupidFileCache ¶
* a stupid cache that needs to be updated manually. * good luck with that. * * it's meant to be abstract, but can be used on its own. * * for linux see the ObservingFileCache with inotify support. * * TODO * check and correct interface definition * turn into StupidReaderCache for io.Reader * add a time based BoringFileCache * add a shared memory cache PromiscuousFileCache
func NewStupidFileCache ¶
func NewStupidFileCache() (cache *StupidFileCache)
func NewStupidFileCacheMaxSize ¶
func NewStupidFileCacheMaxSize(maxSize uint) (cache *StupidFileCache)
func (*StupidFileCache) Free ¶
func (cache *StupidFileCache) Free() uint
func (*StupidFileCache) Get ¶
func (cache *StupidFileCache) Get(filename string) (value []byte, e error)
func (*StupidFileCache) GetMaxFiles ¶
func (cache *StupidFileCache) GetMaxFiles() uint
func (*StupidFileCache) GetMaxSize ¶
func (cache *StupidFileCache) GetMaxSize() uint
func (*StupidFileCache) GetSize ¶
func (cache *StupidFileCache) GetSize() uint
func (*StupidFileCache) GetString ¶
func (cache *StupidFileCache) GetString(filename string) (string, error)
func (*StupidFileCache) Remove ¶
func (cache *StupidFileCache) Remove(filename string)
func (*StupidFileCache) Reset ¶
func (cache *StupidFileCache) Reset()
func (*StupidFileCache) SetMaxFiles ¶
func (cache *StupidFileCache) SetMaxFiles(to uint)
func (*StupidFileCache) SetMaxSize ¶
func (cache *StupidFileCache) SetMaxSize(to uint)
type StupidInterface ¶
type StupidInterface interface { Reset() Remove(filename string) }
Click to show internal directories.
Click to hide internal directories.