Documentation
¶
Index ¶
- type DefaultsCache
- type Entry
- type NamedCache
- func (c *NamedCache[T]) Clear(ctx context.Context)
- func (c *NamedCache[T]) Get(ctx context.Context, name string) (T, bool)
- func (c *NamedCache[T]) Invalidate(ctx context.Context, name string)
- func (c *NamedCache[T]) Set(ctx context.Context, name string, value T)
- func (c *NamedCache[T]) SetWithExpiration(ctx context.Context, name string, value T, expiresAt time.Time)
- func (c *NamedCache[T]) Size() int
- type Stats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultsCache ¶
type DefaultsCache[T any] struct { // contains filtered or unexported fields }
DefaultsCache memoizes generated default configs.
func NewDefaultsCache ¶
func NewDefaultsCache[T any](buildDefault func(string) T) *DefaultsCache[T]
func (*DefaultsCache[T]) GetDefaultConfig ¶
func (c *DefaultsCache[T]) GetDefaultConfig(clusterName string) T
func (*DefaultsCache[T]) Invalidate ¶
func (c *DefaultsCache[T]) Invalidate(clusterName string)
func (*DefaultsCache[T]) InvalidateAll ¶
func (c *DefaultsCache[T]) InvalidateAll()
func (*DefaultsCache[T]) Stats ¶
func (c *DefaultsCache[T]) Stats() Stats
type NamedCache ¶
type NamedCache[T any] struct { // contains filtered or unexported fields }
NamedCache is a generic in-memory cache keyed by configuration name.
func NewNamedCache ¶
func NewNamedCache[T any]() *NamedCache[T]
func (*NamedCache[T]) Clear ¶
func (c *NamedCache[T]) Clear(ctx context.Context)
func (*NamedCache[T]) Invalidate ¶
func (c *NamedCache[T]) Invalidate(ctx context.Context, name string)
func (*NamedCache[T]) SetWithExpiration ¶
func (*NamedCache[T]) Size ¶
func (c *NamedCache[T]) Size() int
Click to show internal directories.
Click to hide internal directories.