config

package
v0.0.0-...-c188a41 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllConf

func AllConf() map[string]interface{}

func GetBool

func GetBool(key string) bool

func GetInt32

func GetInt32(key string) int32

func GetInt64

func GetInt64(key string) int64

func GetString

func GetString(key string) string

func Init

func Init()

func Scan

func Scan(key string, conf interface{}) error

func ScanWithRefresh

func ScanWithRefresh(en viper.Refreshable) error

func SetDefault

func SetDefault(key string, value interface{})

Types

type Manager

type Manager struct {
	Store Store
}

func (Manager) Get

func (c Manager) Get(key string) ([]byte, error)

func (Manager) List

func (c Manager) List(key string) (remote.KVPairs, error)

func (Manager) Set

func (c Manager) Set(key string, value []byte) error

func (Manager) Watch

func (c Manager) Watch(key string, stop chan bool) <-chan *remote.Response

type Store

type Store interface {
	// Get retrieves a value from a K/V Store for the provided key.
	Get(key string) ([]byte, error)

	// List retrieves all keys and values under a provided key.
	List(key string) (remote.KVPairs, error)

	// Set sets the provided key to value.
	Set(key string, value []byte) error

	// Watch monitors a K/V Store for changes to key.
	Watch(key string, stop chan bool) <-chan *remote.Response
}

Jump to

Keyboard shortcuts

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