source

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NacosTimeout  uint64 = 5000
	NacosLogDir          = "/tmp/nacos/log"
	NacosCacheDir        = "/tmp/nacos/cache"
	NacosLogLevel        = "debug"
)

Functions

func ParseNacosAddrs

func ParseNacosAddrs(addrs []string) ([]constant.ServerConfig, error)

Types

type ConfigSource

type ConfigSource interface {
	Read() ([]byte, error)
	Watch() (<-chan Event, error)
	Close() error
}

ConfigSource is the underlying config source for kconfig, responsible for reading config data and watching changes.

func NewConsulSource

func NewConsulSource(addr string, group, key string, lg log.Logger) (ConfigSource, error)

func NewEtcdSource

func NewEtcdSource(addrs []string, group, key string, lg log.Logger) (ConfigSource, error)

func NewFileSource

func NewFileSource(key string, lg log.Logger) (ConfigSource, error)

func NewNacosSource

func NewNacosSource(addrs []string, namespace, group, key string, lg log.Logger) (ConfigSource, error)

type ConfigSourceType

type ConfigSourceType string

ConfigSourceType specifies config sources that kconfig currently supports.

const (
	File   ConfigSourceType = "file" // file can be json, yaml
	Etcd   ConfigSourceType = "etcd" // etcd v3
	Consul ConfigSourceType = "consul"
	Nacos  ConfigSourceType = "nacos"
)

type Event

type Event struct {
	Md5  string
	Data []byte
}

Event represents a config update event. Md5 can be used to filter repeat events.

Jump to

Keyboard shortcuts

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