Documentation ¶
Index ¶
- Constants
- 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 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() (count int, err error)
- func (c *InMemoryCache) Set(key, value []byte) (err error)
Constants ¶
View Source
const RequestsBucketName = "rqbucket"
RequestsBucketName - default name for BoltDB bucket
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 request/response payloads or anything else
type InMemoryCache ¶
Cache used for storing requests and responses 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() (count int, err error)
func (*InMemoryCache) Set ¶
func (c *InMemoryCache) Set(key, value []byte) (err error)
Click to show internal directories.
Click to hide internal directories.