nacos

package
v1.5.23 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 10 Imported by: 3

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 added in v1.1.3

func AddLocalConfigFile(runTime string, filePath string)

注入本地文件配置

func AddNacosConfig

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

注入Nacos配置文件

func CallBackFunc added in v1.1.6

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 added in v1.1.3

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 added in v1.1.6

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

func (*ViperToml) GetConfig added in v1.1.6

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

获取整套配置文件的拼接

func (*ViperToml) NacosToViper added in v1.1.6

func (vt *ViperToml) NacosToViper()

func (*ViperToml) SetCallBackFunc added in v1.1.6

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

配置回调方法

func (*ViperToml) SetDataIds added in v1.1.6

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

设置需要读取哪些配置

func (*ViperToml) SetviperBase added in v1.1.6

func (vt *ViperToml) SetviperBase(configs string)

Jump to

Keyboard shortcuts

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