configmgr

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseConfigManager

type BaseConfigManager[T any] struct {
	// contains filtered or unexported fields
}

func NewBaseConfigManager

func NewBaseConfigManager[T any](store configstore.ConfigStore, def Definition[T]) *BaseConfigManager[T]

func (*BaseConfigManager[T]) Cache

func (m *BaseConfigManager[T]) Cache(item T)

func (*BaseConfigManager[T]) CacheMany

func (m *BaseConfigManager[T]) CacheMany(items map[string]T)

func (*BaseConfigManager[T]) Create

func (m *BaseConfigManager[T]) Create(ctx context.Context, item T) error

func (*BaseConfigManager[T]) CreatePrepared

func (m *BaseConfigManager[T]) CreatePrepared(ctx context.Context, id string, stored any, cached T) error

func (*BaseConfigManager[T]) Delete

func (m *BaseConfigManager[T]) Delete(ctx context.Context, id string) error

func (*BaseConfigManager[T]) Get

func (m *BaseConfigManager[T]) Get(ctx context.Context, id string) (T, error)

func (*BaseConfigManager[T]) GetFresh

func (m *BaseConfigManager[T]) GetFresh(ctx context.Context, id string) (T, error)

func (*BaseConfigManager[T]) InitStatic

func (m *BaseConfigManager[T]) InitStatic(items []T)

func (*BaseConfigManager[T]) IsStatic

func (m *BaseConfigManager[T]) IsStatic(id string) bool

func (*BaseConfigManager[T]) List

func (m *BaseConfigManager[T]) List(ctx context.Context, query ListQuery) ([]T, error)

func (*BaseConfigManager[T]) Refresh added in v0.3.0

func (m *BaseConfigManager[T]) Refresh(ctx context.Context, query ListQuery) error

func (*BaseConfigManager[T]) Reset

func (m *BaseConfigManager[T]) Reset()

func (*BaseConfigManager[T]) Snapshot added in v0.3.0

func (m *BaseConfigManager[T]) Snapshot(query ListQuery) []T

func (*BaseConfigManager[T]) Update

func (m *BaseConfigManager[T]) Update(ctx context.Context, id string, next T) error

func (*BaseConfigManager[T]) UpdatePrepared

func (m *BaseConfigManager[T]) UpdatePrepared(ctx context.Context, id string, stored any, cached T) error

type Definition

type Definition[T any] struct {
	GetID  func(T) string
	Decode func(id string, item any) (T, error)

	Clone func(T) T

	PrepareCreate func(T) (storedObj any, cached T, err error)
	PrepareUpdate func(id string, current T, next T) (storedObj any, cached T, err error)

	ShouldIncludeStatic func(ListQuery) bool
	MatchesListQuery    func(T, ListQuery) bool

	NotConfiguredErr func(id string) error
	ReadOnlyErr      func(id string) error
	StoreNilErr      func() error
}

type ListQuery

type ListQuery struct {
	Tag       string
	TagPrefix string
}

Jump to

Keyboard shortcuts

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