persiststorage

package
v0.0.0-...-fc03dd6 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

func Add

func Add(so Storage, ctx context.Context, key, value string) (err error)

func Delete

func Delete(so Storage, ctx context.Context, key string) (err error)

func Get

func Get(so Storage, ctx context.Context, key string) (value string, err error)

func GetAll

func GetAll(so Storage, ctx context.Context) (result map[string]data.Object, err error)

func ProcessChanges

func ProcessChanges(so Storage, ctx context.Context, dataMap **map[string]data.Object, lock *sync.Mutex) (err error)

func ProcessChangesWithFunction

func ProcessChangesWithFunction(so Storage, ctx context.Context, function ProcessFunc) (err error)

Types

type KubeConfigMapStore

type KubeConfigMapStore struct {
	// contains filtered or unexported fields
}

func (*KubeConfigMapStore) AddEntry

func (s *KubeConfigMapStore) AddEntry(ctx context.Context, entryKey, value string) (err error)

k8s configmap methods

func (*KubeConfigMapStore) DeleteEntry

func (s *KubeConfigMapStore) DeleteEntry(ctx context.Context, entryKey string) (err error)

func (*KubeConfigMapStore) GetName

func (s *KubeConfigMapStore) GetName() (name string)

func (*KubeConfigMapStore) ProcessChanges

func (s *KubeConfigMapStore) ProcessChanges(ctx context.Context, dataMap **map[string]data.Object, lock *sync.Mutex) (err error)

func (*KubeConfigMapStore) ProcessChangesWithFunction

func (s *KubeConfigMapStore) ProcessChangesWithFunction(ctx context.Context, function ProcessFunc) (err error)

func (*KubeConfigMapStore) ReadAllEntries

func (s *KubeConfigMapStore) ReadAllEntries(ctx context.Context) (result map[string]data.Object, err error)

The handler read to DB and build/recovery datastructures in memory

func (*KubeConfigMapStore) ReadEntry

func (s *KubeConfigMapStore) ReadEntry(ctx context.Context, entryKey string) (value string, err error)

type KubeConfigMapStoreBuilder

type KubeConfigMapStoreBuilder struct {
	// contains filtered or unexported fields
}

func NewKubeConfigMapStoreBuilder

func NewKubeConfigMapStoreBuilder() *KubeConfigMapStoreBuilder

func (*KubeConfigMapStoreBuilder) Build

func (b *KubeConfigMapStoreBuilder) Build() (storage *KubeConfigMapStore,
	err error)

func (*KubeConfigMapStoreBuilder) SetClient

func (*KubeConfigMapStoreBuilder) SetFieldOwner

func (b *KubeConfigMapStoreBuilder) SetFieldOwner(
	fieldOwner string) *KubeConfigMapStoreBuilder

func (*KubeConfigMapStoreBuilder) SetJsonAPI

func (*KubeConfigMapStoreBuilder) SetName

func (*KubeConfigMapStoreBuilder) SetNamespace

func (b *KubeConfigMapStoreBuilder) SetNamespace(
	namespace string) *KubeConfigMapStoreBuilder

type ProcessFunc

type ProcessFunc func(dataMap *map[string]data.Object)

ProcessFunc process change function

type Storage

type Storage interface {
	// notification from db to application about db entry changes
	// currently assume the notification is granular to indivial entry
	ReadEntry(ctx context.Context, key string) (value string, err error)
	AddEntry(ctx context.Context, key string, value string) (err error)
	DeleteEntry(ctx context.Context, key string) (err error)
	ReadAllEntries(ctx context.Context) (result map[string]data.Object, err error)
	ProcessChanges(ctx context.Context, dataMap **map[string]data.Object, lock *sync.Mutex) (err error)
	ProcessChangesWithFunction(ctx context.Context, function ProcessFunc) (err error)
}

Storage interface for persistent storage

Jump to

Keyboard shortcuts

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