xcm

package
v0.0.0-...-0e18063 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeginWatchConfig

func BeginWatchConfig(cb func())

func BeginWatchConfigWithContext

func BeginWatchConfigWithContext(cb func(), ctx *Context)

func LoadConfigFile

func LoadConfigFile(filename string) error

func LoadConfigFileWithContext

func LoadConfigFileWithContext(filename string, ctx *Context) error

func MapToStruct

func MapToStruct[T any]() (*T, error)

func MapToStructWithContext

func MapToStructWithContext[T any](ctx *Context) (*T, error)

Types

type Context

type Context struct {
	*viper.Viper
}

func NewContext

func NewContext() *Context

type SafeConf

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

func NewSafeConf

func NewSafeConf[T any](conf *T) *SafeConf[T]

func (*SafeConf[T]) GetConf

func (sc *SafeConf[T]) GetConf() T

func (*SafeConf[T]) SetConf

func (sc *SafeConf[T]) SetConf(conf *T)

type TimeoutBasedMerger

type TimeoutBasedMerger[T any] struct {
	To time.Duration
	// contains filtered or unexported fields
}

func NewTimeoutBasedMerger

func NewTimeoutBasedMerger[T any]() *TimeoutBasedMerger[T]

func NewTimeoutBasedMergerWithTimeout

func NewTimeoutBasedMergerWithTimeout[T any](timeout time.Duration) *TimeoutBasedMerger[T]

func (*TimeoutBasedMerger[T]) Start

func (merger *TimeoutBasedMerger[T]) Start(cb func([]*T)) func(T)

func (*TimeoutBasedMerger[T]) Stop

func (merger *TimeoutBasedMerger[T]) Stop()

Jump to

Keyboard shortcuts

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