Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound means that the key was not found. ErrNotFound = errors.New("key not found") )
Functions ¶
This section is empty.
Types ¶
type InMemory ¶
type InMemory struct {
// contains filtered or unexported fields
}
InMemory is an implementation of the cache interface which stores values in-memory.
func NewInMemory ¶
func NewInMemory() *InMemory
NewInMemory creates a new InMemory instance with default values.
type Interface ¶
type Interface interface { // Get a value from the cache given a key. // // This must be concurrency-safe. Get(key string) (interface{}, error) // Set a key to value mapping in the cache. // // This must be concurrency-safe. Set(key string, value interface{}) error }
Interface is the cache interface that all cache implementations must adhere to at the minimum to be usable in the IPinfo client.
Note that all implementations must be concurrency-safe.
Click to show internal directories.
Click to hide internal directories.