Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrorKeyNotFound = errors.New("key not found")
ErrorKeyNotFound is a sentinel error for indicating that a key used when calling Store.Get was not found.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store interface { // Get retrieves the given key contents, and stores it into the given value // pointer. Returns ErrorKeyNotFound if the given key was not found. Get(ctx context.Context, key string, value interface{}) error // Set stores the given value under the given key. Set(ctx context.Context, key string, value interface{}) error // List returns a list of all keys. List(ctx context.Context) ([]string, error) // Delete removed the given key. Delete(ctx context.Context, key string) error }
Store represents a type that is capable of managing key/value pairs using some backing medium.
func NewAnnotationStore ¶
NewAnnotationStore returns a Store backed by the annotations on a resource.
This Store is intended to be used when running inside of a pod, as it depends on the presence of a service account in order to interact with the Kubernetes API.
func NewConfigMapStore ¶
NewConfigMapStore returns a Store backed by a ConfigMap with the given name.
This Store is intended to be used when running inside of a pod, as it depends on the presence of a service account in order to interact with the Kubernetes API.
This Store assumes full control of, and exclusive access to, the backing ConfigMap as it will be created on-demand when calling Store.Set and automatically deleted when calling Store.Delete (in the event that it is empty).
func NewFileStore ¶
NewFileStore returns a Store backed by files contained within the given directory.
This Store is intended to be used as a fallback, or for testing outside of Kubernetes. It has no dependence on being run inside Kubernetes or on the Kubernetes API.
This Store assumes full control of, and exclusive access to, the backing directory as it will be created on-demand when calling Store.Set and automatically deleted when calling Store.Delete (in the event that it does not contain any other files).
func NewSecretStore ¶
NewSecretStore returns a Store backed by a Secret with the given name.
This Store is intended to be used when running inside of a pod, as it depends on the presence of a service account in order to interact with the Kubernetes API.
This Store assumes full control of, and exclusive access to, the backing Secret as it will be created on-demand when calling Store.Set and automatically deleted when calling Store.Delete (in the event that it is empty).