config

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAny added in v0.9.6

func GetAny(args ...string) jsoniter.Any

func GetBool added in v0.9.6

func GetBool(args ...string) bool

func GetFloat32 added in v0.9.6

func GetFloat32(args ...string) float32

func GetFloat64 added in v0.9.6

func GetFloat64(args ...string) float64

func GetInt added in v0.9.6

func GetInt(args ...string) int

func GetInt32 added in v0.9.6

func GetInt32(args ...string) int32

func GetInt64 added in v0.9.6

func GetInt64(args ...string) int64

func GetString added in v0.9.6

func GetString(args ...string) string

func GetUint added in v0.9.6

func GetUint(args ...string) uint

func GetUint32 added in v0.9.6

func GetUint32(args ...string) uint32

func GetUint64 added in v0.9.6

func GetUint64(args ...string) uint64

func NewConfig

func NewConfig(opts ...Options) *config

func RocConfig added in v0.9.6

func RocConfig() *config

Types

type Option

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

type Options

type Options func(option *Option)

func Backup

func Backup(path string) Options

func EnableDynamic added in v0.9.6

func EnableDynamic() Options

func Prefix

func Prefix(prefix string) Options

func Schema

func Schema(schema string) Options

func Version

func Version(version string) Options

type RConfig added in v0.9.6

type RConfig interface {

	// ConfigListAndSync Get all config and sync to cache
	ConfigListAndSync() error

	// WithConfig Get config with key
	WithConfig(key string) ([]byte, error)

	// SetConfig set config with key value
	SetConfig(key string, value []byte) error

	// Clean clean all config
	Clean() error

	// Delete remove a config with key
	Delete(key string) error

	// Watch watch config and update
	Watch() chan *etcd.Action

	// Backup backup config
	Backup() error

	// LoadFs2Etcd load a config file to etcd
	LoadFs2Etcd() error

	// Close close config
	Close()
}

Jump to

Keyboard shortcuts

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