config

package
v2.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Runtime = "RUN_TIME"
	Local   = "local"
)

Variables

This section is empty.

Functions

func ListenConfig

func ListenConfig(group, dataId string, confPtr interface{}, f func(config string, err error)) error

func New

func New(cfg *Config) (nacosCli config_client.IConfigClient, err error)

func Parse

func Parse(group, dataId, localConfig string, confPtr interface{}) (err error)

Types

type Config

type Config struct {
	NamespaceId string
	Endpoint    string
	AccessKey   string
	SecretKey   string
	RegionId    string        // default: cn-hangzhou
	Timeout     time.Duration // default: 5s
	LogLevel    LogLevel      // default: warn
}

type LogLevel

type LogLevel string
const (
	LogDebug LogLevel = "debug"
	LogWarn  LogLevel = "warn"
	LogError LogLevel = "error"
	LogInfo  LogLevel = "info"
)

Jump to

Keyboard shortcuts

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