Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Refreshable ¶
type Refreshable struct {
// contains filtered or unexported fields
}
A cache that will be refreshed
func New ¶
func New(refreshFunc func() (map[string]interface{}, error)) *Refreshable
func (*Refreshable) Get ¶
func (c *Refreshable) Get(key string) (value interface{}, found bool)
Retrieves the value for the provided key from the cache. It will return an empty string if no value was present. If the key is not present in the cache and more than `lastRefresh` time has passed since the last time the cache was refreshed, we try to refresh the cache again.
Click to show internal directories.
Click to hide internal directories.