Documentation ¶
Index ¶
- func GetDB(name string) *bolt.DB
- type BoltCache
- func (c *BoltCache) Delete(key []byte) error
- func (c *BoltCache) DeleteBucket(name []byte) (err error)
- func (c *BoltCache) DeleteData() error
- func (c *BoltCache) Get(key []byte) (value []byte, err error)
- func (c *BoltCache) GetAllEntries() (values map[string][]byte, err error)
- func (c *BoltCache) GetAllKeys() (keys map[string]bool, err error)
- func (c *BoltCache) GetAllValues() (values [][]byte, err error)
- func (c *BoltCache) RecordsCount() (count int, err error)
- func (c *BoltCache) Set(key, value []byte) error
- type Cache
- type FastCache
- type InMemoryCache
- func (c *InMemoryCache) Delete(key []byte) error
- func (c *InMemoryCache) DeleteData() (err error)
- func (c *InMemoryCache) Get(key []byte) (value []byte, err error)
- func (c *InMemoryCache) GetAllEntries() (map[string][]byte, error)
- func (c *InMemoryCache) GetAllKeys() (keys map[string]bool, err error)
- func (c *InMemoryCache) GetAllValues() (values [][]byte, err error)
- func (c *InMemoryCache) RecordsCount() (int, error)
- func (c *InMemoryCache) Set(key, value []byte) (err error)
- type LRUFastCache
- func (c *LRUFastCache) DeleteData() (err error)
- func (c *LRUFastCache) Get(key interface{}) (value interface{}, found bool)
- func (c *LRUFastCache) GetAllEntries() (map[interface{}]interface{}, error)
- func (c *LRUFastCache) RecordsCount() (count int, err error)
- func (c *LRUFastCache) Set(key, value interface{}) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BoltCache ¶
BoltCache - container to implement Cache instance with BoltDB backend for storage
func NewBoltDBCache ¶
NewBoltDBCache - returns new BoltCache instance
func (*BoltCache) DeleteBucket ¶
DeleteBucket - deletes bucket with all saved data
func (*BoltCache) DeleteData ¶
DeleteData - deletes bucket with all saved data
func (*BoltCache) GetAllEntries ¶
GetAllEntries - returns all keys/values
func (*BoltCache) GetAllKeys ¶
GetAllKeys - gets all current keys
func (*BoltCache) GetAllValues ¶
GetAllValues - returns all values
func (*BoltCache) RecordsCount ¶
RecordsCount - returns records count
type Cache ¶
type Cache interface { Set(key, value []byte) error Get(key []byte) ([]byte, error) GetAllValues() ([][]byte, error) GetAllEntries() (map[string][]byte, error) RecordsCount() (int, error) Delete(key []byte) error DeleteData() error GetAllKeys() (map[string]bool, error) }
Cache - cache interface used to store and retrieve serialized data
type FastCache ¶ added in v1.0.0
type FastCache interface { Set(key, value interface{}) error Get(key interface{}) (interface{}, bool) GetAllEntries() (map[interface{}]interface{}, error) RecordsCount() (int, error) DeleteData() error }
FastCache - cache interface used to store and retrieve any data type which requires no serialization
type InMemoryCache ¶
Cache used for storing serialized data in memory
func NewInMemoryCache ¶
func NewInMemoryCache() *InMemoryCache
func (*InMemoryCache) Delete ¶
func (c *InMemoryCache) Delete(key []byte) error
func (*InMemoryCache) DeleteData ¶
func (c *InMemoryCache) DeleteData() (err error)
func (*InMemoryCache) GetAllEntries ¶
func (c *InMemoryCache) GetAllEntries() (map[string][]byte, error)
func (*InMemoryCache) GetAllKeys ¶
func (c *InMemoryCache) GetAllKeys() (keys map[string]bool, err error)
func (*InMemoryCache) GetAllValues ¶
func (c *InMemoryCache) GetAllValues() (values [][]byte, err error)
func (*InMemoryCache) RecordsCount ¶
func (c *InMemoryCache) RecordsCount() (int, error)
func (*InMemoryCache) Set ¶
func (c *InMemoryCache) Set(key, value []byte) (err error)
type LRUFastCache ¶ added in v1.0.0
type LRUFastCache struct {
// contains filtered or unexported fields
}
Fixed size LRU cache for storing any data type
func NewDefaultLRUCache ¶ added in v1.0.0
func NewDefaultLRUCache() *LRUFastCache
func NewLRUCache ¶ added in v1.0.0
func NewLRUCache(size int) (*LRUFastCache, error)
func (*LRUFastCache) DeleteData ¶ added in v1.0.0
func (c *LRUFastCache) DeleteData() (err error)
func (*LRUFastCache) Get ¶ added in v1.0.0
func (c *LRUFastCache) Get(key interface{}) (value interface{}, found bool)
func (*LRUFastCache) GetAllEntries ¶ added in v1.0.0
func (c *LRUFastCache) GetAllEntries() (map[interface{}]interface{}, error)
func (*LRUFastCache) RecordsCount ¶ added in v1.0.0
func (c *LRUFastCache) RecordsCount() (count int, err error)
func (*LRUFastCache) Set ¶ added in v1.0.0
func (c *LRUFastCache) Set(key, value interface{}) (err error)
Click to show internal directories.
Click to hide internal directories.