kvstore

package
v0.0.0-...-f384223 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Simple abstraction for storing state on a k8s ConfigMap. Very very simple and uses a single entry in the ConfigMap.data for storing serialized JSON of the generic data that Load/Save uses. Handy for things like sources that need to persist some state (checkpointing for example).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// Init loads the configstore from the backing store if it exists, or
	// if it does not, will create an empty one.
	Init(ctx context.Context) error
	// Load loads the configstore from the backing store
	Load(ctx context.Context) error
	// Save saves the configstore to the backing store
	Save(ctx context.Context) error
	// Get gets the key from the KVStore into the provided value
	Get(ctx context.Context, key string, value interface{}) error
	// Set sets the key into the KVStore from the provided value
	Set(ctx context.Context, key string, value interface{}) error
}

func NewConfigMapKVStore

func NewConfigMapKVStore(ctx context.Context, name string, namespace string, clientset v1.CoreV1Interface) Interface

Jump to

Keyboard shortcuts

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