config

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAddrIsEmpty    = errors.New("config center addr is empty")
	ErrContentIsEmpty = errors.New("config content is empty")
)

Functions

This section is empty.

Types

type ConsulConfig

type ConsulConfig struct {
	Client *api.Client

	Addr      string `json:"addr"`
	Namespace string `json:"namespace"`
	ServiceId string `json:"serviceId"`
}

func (*ConsulConfig) LoadConsulConfig

func (c *ConsulConfig) LoadConsulConfig(conf interface{}) (err error)

LoadConsulConfig 引导 consul 配置数据给 conf

type FileConfig

type FileConfig struct {
	Path string `json:"path"`
}

func (*FileConfig) LoadFileConfig

func (c *FileConfig) LoadFileConfig(conf interface{}) (err error)

LoadFileConfig 引导 file 配置数据给 conf

type NacosConfig

type NacosConfig struct {
	Client config_client.IConfigClient

	Addr      string `json:"addr"`
	Namespace string `json:"namespace"`
	DataId    string `json:"dataId"`
	Group     string `json:"group"`
}

func (*NacosConfig) CancelListenConfig

func (c *NacosConfig) CancelListenConfig() (err error)

CancelListenConfig 取消配置监听

func (*NacosConfig) ListenConfig

func (c *NacosConfig) ListenConfig(conf interface{})

ListenConfig 配置监听

func (*NacosConfig) LoadNacosConfig

func (c *NacosConfig) LoadNacosConfig(conf interface{}) (err error)

LoadNacosConfig 引导 nacos 配置数据给 conf

Jump to

Keyboard shortcuts

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