cache

package
v1.14.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2020 License: AGPL-3.0 Imports: 2 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL