Documentation
¶
Index ¶
- Variables
- func EncodeGob(e interface{}) (*bytes.Buffer, error)
- func InsertGob(store Storage, key string, e interface{}) error
- func InsertKV(store Storage, key, value string) error
- func RetrieveGob(store Storage, key string, e interface{}) error
- func RetrieveKV(store Storage, key string) (string, error)
- type Storage
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("key does not exist")
)
Errors
Functions ¶
func RetrieveGob ¶
Types ¶
type Storage ¶
type Storage interface { // Insert a new value into the store Insert(key string, value []byte) error // Retrieve will attempt to find the key in the store. Returns // nil if it does not exist with an ErrNotFound Retrieve(key string) ([]byte, error) // Remove will silently attempt to delete the key from the store Remove(key string) error // Flush will empty the store Flush() error // Len returns the number of keys in the store (eg. Length of the cache/Count of items) Len() uint // Size returns the bytes used to store the keys Size() uint64 // Close the cache store and any associated resources. Close() }
Click to show internal directories.
Click to hide internal directories.