Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FillCache ¶
FillCache is a cache whose entries are calculated and filled on-demand
func NewFillCache ¶
NewFillCache creates a `FillCache` whose entries will be computed by the given `FillFunc`
func (*FillCache) RefreshLoop ¶
RefreshLoop runs in a separate goroutine for the key in the cache and updates the cache value for that key every refreshTTL
type MemberSet ¶
type MemberSet map[string]struct{}
MemberSet represents a set of all the members for a given group key in the cache
type MemberSetCache ¶
type MemberSetCache interface { // Get returns a MemberSet from the cache Get(string) (MemberSet, bool) // Update updates the MemberSet of a given key, return a boolean updated value, and and error Update(string) (bool, error) // RefreshLoop starts an update refresh loop for a given key and returns a boolean value of it was started RefreshLoop(string) bool // Stop is a function to stop all goroutines that may have been spun up for the cache. Stop() }
MemberSetCache represents a cache of members of a set
type MockCache ¶
type MockCache struct { ListMembershipsFunc func(string) (MemberSet, bool) Exists bool Updated bool UpdateError error Refreshed bool }
MockCache is a mock of MemberSetCache that can be used for testing purposes
func (*MockCache) RefreshLoop ¶
RefreshLoop returns a boolean of if the refresh loop is refreshed
Click to show internal directories.
Click to hide internal directories.