Documentation ¶
Index ¶
- Constants
- func NewConnectionBackoff() *backoff.ExponentialBackOff
- func NewDatabaseBackoff() backoff.BackOff
- func NewRand(lock bool) *rand.Rand
- func Value[T any](cfg Config, fn func(Config) T) func() T
- func Values[T1, T2 any](cfg Config, fn func(Config) (T1, T2)) func() (T1, T2)
- type Config
- type Duration
- type Loader
Constants ¶
View Source
const ( // ConnectionRetryMaxInterval indicates the maximum interval to retry icecast // connections ConnectionRetryMaxInterval = time.Second * 2 // ConnectionRetryMaxElapsedTime indicates how long to try retry before // erroring out completely. Set to 0 means it never errors out ConnectionRetryMaxElapsedTime = time.Second * 0 )
View Source
const ( // DatabaseRetryMaxInterval indicates the maximum interval between database // call retries after an error occurs DatabaseRetryMaxInterval = time.Second * 5 // DatabaseRetryMaxElapsedTime indicates how long to try again before // erroring out. Set to 0 means it never errors out DatabaseRetryMaxElapsedTime = time.Second * 0 )
Variables ¶
This section is empty.
Functions ¶
func NewConnectionBackoff ¶
func NewConnectionBackoff() *backoff.ExponentialBackOff
NewConnectionBackoff returns a new backoff set to the intended configuration for local connection retrying, for connections going to non-local addresses don't use this
func NewDatabaseBackoff ¶
NewDatabaseBackoff returns a new backoff set to the intended configuration for database retrying
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is a type-safe wrapper around the config type
func (Config) Conf ¶
func (c Config) Conf() config
Conf returns the configuration stored inside
NOTE: Conf returns a shallow-copy of the config value stored inside; so do not edit
any slices or maps that might be inside
func (Config) LoadAndUpdate ¶
func (Config) StoreConf ¶
func (c Config) StoreConf(new config)
StoreConf stores the configuration passed
func (Config) TriggerReload ¶
func (c Config) TriggerReload()
type Duration ¶
Duration is a time.Duration that supports Text(Un)Marshaler
func (Duration) MarshalText ¶
MarshalText implements encoding.TextMarshaler
func (*Duration) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler
Click to show internal directories.
Click to hide internal directories.