configutil

package
v1.52.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAtomicBool

func NewAtomicBool[C any](config Observable[C], accessor func(*C) bool) *atomic.Bool

func NewAtomicDuration

func NewAtomicDuration[C any](config Observable[C], accessor func(*C) time.Duration) *atomic.Duration

func NewAtomicFloat32

func NewAtomicFloat32[C any](config Observable[C], accessor func(*C) float32) *atomic.Float32

func NewAtomicFloat64

func NewAtomicFloat64[C any](config Observable[C], accessor func(*C) float64) *atomic.Float64

func NewAtomicInt32

func NewAtomicInt32[C any](config Observable[C], accessor func(*C) int32) *atomic.Int32

func NewAtomicInt64

func NewAtomicInt64[C any](config Observable[C], accessor func(*C) int64) *atomic.Int64

func NewAtomicPointer

func NewAtomicPointer[T, C any](config Observable[C], accessor func(*C) *T) *atomic.Pointer[T]

func NewAtomicString

func NewAtomicString[C any](config Observable[C], accessor func(*C) string) *atomic.String

func NewAtomicTime

func NewAtomicTime[C any](config Observable[C], accessor func(*C) time.Time) *atomic.Time

func NewAtomicUint32

func NewAtomicUint32[C any](config Observable[C], accessor func(*C) uint32) *atomic.Uint32

func NewAtomicUint64

func NewAtomicUint64[C any](config Observable[C], accessor func(*C) uint64) *atomic.Uint64

Types

type AtomicValue

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

func NewAtomicValue

func NewAtomicValue[T, C any](config Observable[C], accessor func(*C) T) *AtomicValue[T]

func (*AtomicValue[T]) Load

func (a *AtomicValue[T]) Load() T

func (*AtomicValue[T]) Store

func (a *AtomicValue[T]) Store(v T)

type Builder added in v1.51.0

type Builder[T any] interface {
	New() (*T, error)
}

type ConfigObserver

type ConfigObserver[T any] = Observable[T]

type Defaulter added in v1.51.0

type Defaulter[T any] interface {
	InitDefaults(*T) error
}

type Observable added in v1.51.0

type Observable[T any] interface {
	Observe(cb func(*T)) func()
	Load() *T
}

type Observer added in v1.51.0

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

func NewObserver added in v1.51.0

func NewObserver[T any](path string, builder Builder[T]) (*Observer[T], *T, error)

func (*Observer[T]) Close added in v1.51.0

func (c *Observer[T]) Close()

func (*Observer[T]) EmitConfigUpdate added in v1.51.0

func (c *Observer[T]) EmitConfigUpdate(conf *T)

func (*Observer[T]) Load added in v1.51.0

func (c *Observer[T]) Load() *T

func (*Observer[T]) Observe added in v1.51.0

func (c *Observer[T]) Observe(cb func(*T)) func()

Jump to

Keyboard shortcuts

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