Documentation ¶
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockStore ¶ added in v0.1.12
MockStore implements Client interface. It stores cache key-value mappings in memory.
func (MockStore) Cleanup ¶ added in v0.1.12
Cleanup does nothing, but is implemented to comply with Client interface.
type Store ¶
Store is the interface that the CacheManager relies on to find the mapping between cacheID and layer name. The Get function returns an empty string and no error if the key was not found in the store. Cleanup closes potential connections to the store.
func NewFSStore ¶
NewFSStore returns a Store backed by the local filesystem. Entries are stored in json format. TODO: enforce capacity.
func NewHTTPStore ¶
NewHTTPStore returns a new instance of Store backed by a server that implements the following API: GET <address>/key => http.StatusOK with value in body PUT <address>/key => 200 <= code < 300 The "headers" entries are of the form <header>:<value>.
func NewRedisStore ¶
NewRedisStore returns a new instance of Store backed by a redis server. In this constructor we try to open a connection to redis. If that attempt fails we return an error. If it succeeds we just close that connection.