Documentation
¶
Overview ¶
Package fastcache implementing a fast cache in memory and fast file storage
Index ¶
- Constants
- type FastCache
- func (f *FastCache) AddRetention(_ *model.RetentionEntry) error
- func (f *FastCache) CheckBlob(id string) (*model.CheckInfo, error)
- func (f *FastCache) Close() error
- func (f *FastCache) DeleteBlob(id string) error
- func (f *FastCache) DeleteRetention(_ string) error
- func (f *FastCache) GetAllRetentions(_ func(r model.RetentionEntry) bool) error
- func (f *FastCache) GetBlobDescription(id string) (*model.BlobDescription, error)
- func (f *FastCache) GetBlobs(callback func(id string) bool) error
- func (f *FastCache) GetLastError() error
- func (f *FastCache) GetRetention(_ string) (model.RetentionEntry, error)
- func (f *FastCache) GetTenant() string
- func (f *FastCache) HasBlob(id string) (bool, error)
- func (f *FastCache) Init() error
- func (f *FastCache) ResetRetention(_ string) error
- func (f *FastCache) RetrieveBlob(id string, w io.Writer) error
- func (f *FastCache) SearchBlobs(_ string, _ func(id string) bool) error
- func (f *FastCache) StoreBlob(b *model.BlobDescription, r io.Reader) (string, error)
- func (f *FastCache) UpdateBlobDescription(id string, b *model.BlobDescription) error
- type LRUEntry
- type LRUList
- func (l *LRUList) Add(e LRUEntry) bool
- func (l *LRUList) Delete(id string) string
- func (l *LRUList) Get(id string) (LRUEntry, bool)
- func (l *LRUList) GetFullIDList() []string
- func (l *LRUList) HandleContrains() string
- func (l *LRUList) Has(id string) bool
- func (l *LRUList) Init()
- func (l *LRUList) Size() int
- func (l *LRUList) Update(e LRUEntry)
- func (l *LRUList) UpdateAccess(id string)
Constants ¶
const ( // BinaryExt extension for binary files BinaryExt = ".bin" // Defaultmffrs this is the max size of a blob that will be stored into memory, if possible Defaultmffrs = 100 * 1024 // DefaultTnt the default tenant. Because this storage isn't tenant specific DefaultTnt = "n.n." )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FastCache ¶
type FastCache struct { RootPath string // this is the root path for the file system storage MaxCount int64 MaxRAMSize int64 MaxFileSizeForRAM int64 // contains filtered or unexported fields }
FastCache a fast cache implementation using a mix of memory and fast ssd storage
func (*FastCache) AddRetention ¶
func (f *FastCache) AddRetention(_ *model.RetentionEntry) error
AddRetention adding a retention entry to the storage
func (*FastCache) DeleteBlob ¶
DeleteBlob removing a blob from the storage system
func (*FastCache) DeleteRetention ¶
DeleteRetention deletes the retention entry from the storage
func (*FastCache) GetAllRetentions ¶
func (f *FastCache) GetAllRetentions(_ func(r model.RetentionEntry) bool) error
GetAllRetentions for every retention entry for this tenant we call this this function, you can stop the listing by returning a false
func (*FastCache) GetBlobDescription ¶
func (f *FastCache) GetBlobDescription(id string) (*model.BlobDescription, error)
GetBlobDescription getting the description of the file
func (*FastCache) GetLastError ¶
GetLastError returning the last error (niy)
func (*FastCache) GetRetention ¶
func (f *FastCache) GetRetention(_ string) (model.RetentionEntry, error)
GetRetention getting a single retention entry
func (*FastCache) ResetRetention ¶
ResetRetention resets the retention for a blob
func (*FastCache) RetrieveBlob ¶
RetrieveBlob retrieving the binary data from the storage system
func (*FastCache) SearchBlobs ¶
SearchBlobs querying a single blob, niy
func (*FastCache) UpdateBlobDescription ¶
func (f *FastCache) UpdateBlobDescription(id string, b *model.BlobDescription) error
UpdateBlobDescription updating the blob description
type LRUEntry ¶
type LRUEntry struct { LastAccess time.Time `json:"lastAccess"` Description model.BlobDescription `json:"description"` Data []byte `json:"data"` }
LRUEntry one lru list entry
type LRUList ¶
LRUList the full ist of lru entries
func (*LRUList) GetFullIDList ¶
GetFullIDList getting a copy of the full id list of all entries
func (*LRUList) HandleContrains ¶
HandleContrains doing the self reoganising
func (*LRUList) UpdateAccess ¶
UpdateAccess updates the access time of an entry