Documentation ¶
Overview ¶
Package cache provides a public interface and implementation for an in-memory cache that keeps the most recent response from the control plane per aggregated key.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { // Fetch returns the cached resource if it exists. Fetch(key string) (*Resource, error) // SetResponse sets the cache response and returns the list of requests. SetResponse(key string, resp transport.Response) (*RequestsStore, error) // AddRequest adds the request to the cache. AddRequest(key string, req transport.Request) error // DeleteRequest removes the given request from any cache entries it's present in. DeleteRequest(key string, req transport.Request) error // DeleteKey removes the given key from cache. DeleteKey(key string) error // GetReadOnlyCache returns a copy of the cache that only exposes read-only methods in its interface. GetReadOnlyCache() ReadOnlyCache }
type OnEvictFunc ¶
OnEvictFunc is a callback function for each eviction. Receives the key and cache value when called.
type ReadOnlyCache ¶
type RequestsStore ¶
type RequestsStore struct {
// contains filtered or unexported fields
}
func NewRequestsStore ¶
func NewRequestsStore() *RequestsStore
func (*RequestsStore) Delete ¶
func (m *RequestsStore) Delete(r transport.Request)
func (*RequestsStore) ForEach ¶
func (m *RequestsStore) ForEach(f func(key transport.Request))
func (*RequestsStore) Set ¶
func (m *RequestsStore) Set(r transport.Request)
Click to show internal directories.
Click to hide internal directories.