nacos

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ViperTomlHarder = &ViperToml{
	callbackList: make(map[string]func(namespace, group, dataId, data string)),
	callbackRun:  false,
}

Functions

func AddAcmConfig

func AddAcmConfig(runTime string, ccConfig constant.ClientConfig) error

注入ACM配置文件

func AddLocalConfig

func AddLocalConfig(runTime string, configs string)

注入本地文件配置

func AddLocalConfigFile

func AddLocalConfigFile(runTime string, filePath string)

注入本地文件配置

func AddNacosConfig

func AddNacosConfig(runTime string, ccConfig constant.ClientConfig, csConfigs []constant.ServerConfig) error

注入Nacos配置文件

func CallBackFunc

func CallBackFunc(group, dataId string, callbark func(namespace, group, dataId, data string)) error

配置回调方法

func GetConfig

func GetConfig(group string, dataIds string) string

func NewLocalNacos

func NewLocalNacos(configs string) config_client.IConfigClient

func NewLocalNacosFile

func NewLocalNacosFile(filepath string) config_client.IConfigClient

func SetRunTime

func SetRunTime(runtime string)

设置环境变量

Types

type LocalNacos

type LocalNacos struct {
	FilePath string

	config_client.IConfigClient
	// contains filtered or unexported fields
}

func (*LocalNacos) DeleteConfig

func (l *LocalNacos) DeleteConfig(param vo.ConfigParam) (bool, error)

删除配置

func (*LocalNacos) GetConfig

func (l *LocalNacos) GetConfig(param vo.ConfigParam) (string, error)

获取配置

func (*LocalNacos) ListenConfig

func (l *LocalNacos) ListenConfig(params vo.ConfigParam) (err error)

监听配置

func (*LocalNacos) PublishConfig

func (l *LocalNacos) PublishConfig(param vo.ConfigParam) (bool, error)

发布配置

type ViperToml

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

func (*ViperToml) GetConfig

func (vt *ViperToml) GetConfig() (string, error)

获取整套配置文件的拼接

func (*ViperToml) NacosToViper

func (vt *ViperToml) NacosToViper()

func (*ViperToml) NacosToViperFile

func (vt *ViperToml) NacosToViperFile(basefiles ...string)

func (*ViperToml) SetCallBackFunc

func (vt *ViperToml) SetCallBackFunc(group, dataId string, callbark func(namespace, group, dataId, data string))

配置回调方法

func (*ViperToml) SetDataIds

func (vt *ViperToml) SetDataIds(group string, dataIds ...string)

设置需要读取哪些配置

func (*ViperToml) SetviperBase

func (vt *ViperToml) SetviperBase(configs string)

Jump to

Keyboard shortcuts

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