Documentation
¶
Index ¶
- type BaseConfigManager
- func (m *BaseConfigManager[T]) Cache(item T)
- func (m *BaseConfigManager[T]) CacheMany(items map[string]T)
- func (m *BaseConfigManager[T]) Create(ctx context.Context, item T) error
- func (m *BaseConfigManager[T]) CreatePrepared(ctx context.Context, id string, stored any, cached T) error
- func (m *BaseConfigManager[T]) Delete(ctx context.Context, id string) error
- func (m *BaseConfigManager[T]) Get(ctx context.Context, id string) (T, error)
- func (m *BaseConfigManager[T]) GetFresh(ctx context.Context, id string) (T, error)
- func (m *BaseConfigManager[T]) InitStatic(items []T)
- func (m *BaseConfigManager[T]) IsStatic(id string) bool
- func (m *BaseConfigManager[T]) List(ctx context.Context, query ListQuery) ([]T, error)
- func (m *BaseConfigManager[T]) Refresh(ctx context.Context, query ListQuery) error
- func (m *BaseConfigManager[T]) Reset()
- func (m *BaseConfigManager[T]) Snapshot(query ListQuery) []T
- func (m *BaseConfigManager[T]) Update(ctx context.Context, id string, next T) error
- func (m *BaseConfigManager[T]) UpdatePrepared(ctx context.Context, id string, stored any, cached T) error
- type Definition
- type ListQuery
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 (*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 ¶
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 }
Click to show internal directories.
Click to hide internal directories.