configmgr

package
v2.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DotenvConfigFormat nacosConfigType = "dotenv"
	YamlConfigFormat   nacosConfigType = "yaml"
)

Variables

View Source
var ApolloClient agollo.Client
View Source
var NewConfigClient = clients.NewConfigClient
View Source
var StartWithConfig = agollo.StartWithConfig
View Source
var StringReader = func(s string) io.Reader {
	return strings.NewReader(s)
}

Functions

func InitialiseApolloConfig

func InitialiseApolloConfig(appConfig *config.AppConfig)

func InitialiseNacosConfig

func InitialiseNacosConfig(param vo.NacosClientParam, dataId, format, group string)

func LoadFromApollo

func LoadFromApollo(appConfig *config.AppConfig)

func LoadFromNacos

func LoadFromNacos(param vo.NacosClientParam, dataId, format, group string) error

Types

type BaseApolloListener

type BaseApolloListener struct {
	SkippedFirstEvent bool
	Lock              sync.Mutex
}

func (*BaseApolloListener) OnNewestChange

func (c *BaseApolloListener) OnNewestChange(event *storage.FullChangeEvent)

type NacosChangeEvent

type NacosChangeEvent struct {
	Namespace, Group, DataId string
	Changes                  map[string]maputils.Change
}

type NacosConfigListenerParam

type NacosConfigListenerParam struct {
	DataId   string
	OnChange func(event *NacosChangeEvent)
}

type NacosConfigMgr

type NacosConfigMgr struct {
	// contains filtered or unexported fields
}
var NacosClient *NacosConfigMgr

func NewNacosConfigMgr

func NewNacosConfigMgr(dataIds []string, group string, format nacosConfigType, namespaceId string, client config_client.IConfigClient, listeners cache.ConcurrentMap) *NacosConfigMgr

func (*NacosConfigMgr) AddChangeListener

func (m *NacosConfigMgr) AddChangeListener(param NacosConfigListenerParam)

func (*NacosConfigMgr) CallbackOnChange

func (m *NacosConfigMgr) CallbackOnChange(namespace, group, dataId, data, old string)

func (*NacosConfigMgr) Listeners

func (m *NacosConfigMgr) Listeners() cache.ConcurrentMap

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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