configuration

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PatternService is the pattern of service name
	PatternService = "config#%s#%s#%s"
	// CacheSuffix filesystem suffix
	CacheSuffix = ".json"
	// PatternGlob is the pattern of glob
	PatternGlob = "#?*#?*#?*"
)
View Source
const (
	NotExistedFileContent = string("@@not_existed@@")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheFileInfo

type CacheFileInfo struct {
	Msg      proto.Message
	FileInfo os.FileInfo
}

CacheFileInfo 文件信息

type CachePersistHandler

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

CachePersistHandler 持久化工具类

func NewCachePersistHandler

func NewCachePersistHandler(persistDir string, maxWriteRetry int,
	maxReadRetry int, retryInterval time.Duration) (*CachePersistHandler, error)

NewCachePersistHandler create persistence handler

func (*CachePersistHandler) DeleteCacheFromFile

func (cph *CachePersistHandler) DeleteCacheFromFile(fileName string)

DeleteCacheFromFile 删除缓存文件

func (*CachePersistHandler) LoadMessageFromFile

func (cph *CachePersistHandler) LoadMessageFromFile(relativeFile string, message interface{}) error

LoadMessageFromFile 从相对文件中加载缓存

func (*CachePersistHandler) SaveMessageToFile

func (cph *CachePersistHandler) SaveMessageToFile(fileName string, svcResp interface{})

SaveMessageToFile 按服务来进行缓存存储

type ConfigFileFlow

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

ConfigFileFlow 配置中心核心服务门面类

func NewConfigFileFlow

func NewConfigFileFlow(connector configconnector.ConfigConnector, chain configfilter.Chain,
	configuration config.Configuration) (*ConfigFileFlow, error)

NewConfigFileFlow 创建配置中心服务

func (*ConfigFileFlow) Destroy

func (c *ConfigFileFlow) Destroy()

Destroy 销毁服务

func (*ConfigFileFlow) GetConfigFile

func (c *ConfigFileFlow) GetConfigFile(namespace, fileGroup, fileName string) (model.ConfigFile, error)

GetConfigFile 获取配置文件

type ConfigFileRepo

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

ConfigFileRepo 服务端配置文件代理类,从服务端拉取配置并同步数据

func (*ConfigFileRepo) AddChangeListener

func (r *ConfigFileRepo) AddChangeListener(listener ConfigFileRepoChangeListener)

AddChangeListener 添加配置文件变更监听器

func (*ConfigFileRepo) GetContent

func (r *ConfigFileRepo) GetContent() string

GetContent 获取配置文件内容

func (*ConfigFileRepo) GetNotifiedVersion

func (r *ConfigFileRepo) GetNotifiedVersion() uint64

type ConfigFileRepoChangeListener

type ConfigFileRepoChangeListener func(configFileMetadata model.ConfigFileMetadata, newContent string) error

ConfigFileRepoChangeListener 远程配置文件发布监听器

Jump to

Keyboard shortcuts

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