config

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 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

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

func GetBool

func GetBool(args ...string) bool

func GetFloat32

func GetFloat32(args ...string) float32

func GetFloat64

func GetFloat64(args ...string) float64

func GetInt

func GetInt(args ...string) int

func GetInt32

func GetInt32(args ...string) int32

func GetInt64

func GetInt64(args ...string) int64

func GetString

func GetString(args ...string) string

func GetUint

func GetUint(args ...string) uint

func GetUint32

func GetUint32(args ...string) uint32

func GetUint64

func GetUint64(args ...string) uint64

func NewConfig

func NewConfig(opts ...Options) *config

func RocConfig

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

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

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