configwatch

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Watch

func Watch(o *onion.Onion)

Watch get an onion and watch over it for changes in the layers.

func WatchContext

func WatchContext(ctx context.Context, o *onion.Onion)

WatchContext get an onion and watch over it for changes in the layers.

Types

type Bool

type Bool interface {
	// The bool value
	Bool() bool
}

Bool is the bool value holder, with safe lock for concurrent reload

func RegisterBool

func RegisterBool(key string, def bool) Bool

RegisterBool return an bool variable and set the value when the config is loaded

type Float

type Float interface {
	Float32() float32
	Float64() float64
}

Float is the float value holder, with safe lock for concurrent reload

func RegisterFloat32

func RegisterFloat32(key string, def float32) Float

RegisterFloat32 return an float32 variable and set the value when the config is loaded

func RegisterFloat64

func RegisterFloat64(key string, def float64) Float

RegisterFloat64 return an float64 variable and set the value when the config is loaded

type Int

type Int interface {
	// Return the int value
	Int() int
	// Return int64 value
	Int64() int64
	// Return duration value
	Duration() time.Duration
}

Int is the int value holder, with safe lock for concurrent reload

func RegisterDuration

func RegisterDuration(key string, def time.Duration) Int

RegisterDuration return an duration variable and set the value when the config is loaded

func RegisterInt

func RegisterInt(key string, def int) Int

RegisterInt return an int variable and set the value when the config is loaded

func RegisterInt64

func RegisterInt64(key string, def int64) Int

RegisterInt64 return an int64 variable and set the value when the config is loaded

type RefWatch

type RefWatch struct {
	// contains filtered or unexported fields
}

RefWatch is a class to watch over the onion instance and change the registered variables

func (*RefWatch) RegisterBool

func (rw *RefWatch) RegisterBool(key string, def bool) Bool

RegisterBool return an bool variable and set the value when the config is loaded

func (*RefWatch) RegisterDuration

func (rw *RefWatch) RegisterDuration(key string, def time.Duration) Int

RegisterDuration return an duration variable and set the value when the config is loaded

func (*RefWatch) RegisterFloat32

func (rw *RefWatch) RegisterFloat32(key string, def float32) Float

RegisterFloat32 return an float32 variable and set the value when the config is loaded

func (*RefWatch) RegisterFloat64

func (rw *RefWatch) RegisterFloat64(key string, def float64) Float

RegisterFloat64 return an float64 variable and set the value when the config is loaded

func (*RefWatch) RegisterInt

func (rw *RefWatch) RegisterInt(key string, def int) Int

RegisterInt return an int variable and set the value when the config is loaded

func (*RefWatch) RegisterInt64

func (rw *RefWatch) RegisterInt64(key string, def int64) Int

RegisterInt64 return an int64 variable and set the value when the config is loaded

func (*RefWatch) RegisterString

func (rw *RefWatch) RegisterString(key string, def string) String

RegisterString return an string variable and set the value when the config is loaded

func (*RefWatch) Watch

func (rw *RefWatch) Watch(ctx context.Context, o *onion.Onion)

Watch get an onion and watch over it for changes in the layers.

type String

type String interface {
	String() string
}

String is the string value holder, with safe lock for concurrent reload

func RegisterString

func RegisterString(key string, def string) String

RegisterString return an string variable and set the value when the config is loaded

Jump to

Keyboard shortcuts

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