Versions in this module Expand all Collapse all v1 v1.0.0 Sep 28, 2017 Changes in this version + var EmptyDataBlock = &DataBlock + var ErrAlreadyStored = errors.New("That file ID is already stored") + var ErrEntityTooLarge = errors.New("Data is larger than the allowed size.") + var ErrLargerThanCache = errors.New("Data is larger than the the total cache size") + var ErrNoData = errors.New("No data") + var ErrRemoval = errors.New("Can't remove a file ID that does not exist") + type DataBlock struct + func NewDataBlock(data []byte, compressionSpeed bool) *DataBlock + func (b *DataBlock) Compress() error + func (b *DataBlock) Decompress() error + func (b *DataBlock) Gzipped() ([]byte, int, error) + func (b *DataBlock) HasData() bool + func (b *DataBlock) IsCompressed() bool + func (b *DataBlock) Length() int + func (b *DataBlock) MustData() []byte + func (b *DataBlock) String() string + func (b *DataBlock) StringLength() string + func (b *DataBlock) ToClient(w http.ResponseWriter, req *http.Request, name string, canGzip bool, ...) + func (b *DataBlock) UncompressedData() ([]byte, int, error) + type FileCache struct + func NewFileCache(cacheSize uint64, compress bool, maxEntitySize uint64, compressionSpeed bool) *FileCache + func (cache *FileCache) Clear() + func (cache *FileCache) IsEmpty() bool + func (cache *FileCache) Read(filename string, cached bool) (*DataBlock, error) + func (cache *FileCache) Stats() string + type FileStat struct + func NewFileStat(useCache bool, clearStatCacheDelay time.Duration) *FileStat + func (fs *FileStat) Exists(path string) bool + func (fs *FileStat) IsDir(path string) bool + func (fs *FileStat) Sleep(extraSleep time.Duration)