Documentation ¶
Index ¶
- Constants
- type CacheFileInfo
- type CachePersistHandler
- type ConfigFileFlow
- func (c *ConfigFileFlow) CreateConfigFile(namespace, fileGroup, fileName, content string) error
- func (c *ConfigFileFlow) Destroy()
- func (c *ConfigFileFlow) GetConfigFile(namespace, fileGroup, fileName string) (model.ConfigFile, error)
- func (c *ConfigFileFlow) PublishConfigFile(namespace, fileGroup, fileName string) error
- func (c *ConfigFileFlow) UpdateConfigFile(namespace, fileGroup, fileName, content string) error
- type ConfigFileRepo
- type ConfigFileRepoChangeListener
- type ConfigFlow
- type ConfigGroupFlow
- type ConfigGroupRepo
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@@")
)
View Source
const (
PullConfigMaxRetryTimes = 3
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheFileInfo ¶ added in v1.5.4
CacheFileInfo 文件信息
type CachePersistHandler ¶ added in v1.5.4
type CachePersistHandler struct {
// contains filtered or unexported fields
}
CachePersistHandler 持久化工具类
func NewCachePersistHandler ¶ added in v1.5.4
func NewCachePersistHandler(persistDir string, maxWriteRetry int, maxReadRetry int, retryInterval time.Duration) (*CachePersistHandler, error)
NewCachePersistHandler create persistence handler
func (*CachePersistHandler) DeleteCacheFromFile ¶ added in v1.5.4
func (cph *CachePersistHandler) DeleteCacheFromFile(fileName string)
DeleteCacheFromFile 删除缓存文件
func (*CachePersistHandler) LoadMessageFromFile ¶ added in v1.5.4
func (cph *CachePersistHandler) LoadMessageFromFile(relativeFile string, message interface{}) error
LoadMessageFromFile 从相对文件中加载缓存
func (*CachePersistHandler) SaveMessageToFile ¶ added in v1.5.4
func (cph *CachePersistHandler) SaveMessageToFile(fileName string, svcResp interface{})
SaveMessageToFile 按服务来进行缓存存储
type ConfigFileFlow ¶ added in v1.5.0
type ConfigFileFlow struct {
// contains filtered or unexported fields
}
ConfigFileFlow 配置中心核心服务门面类
func NewConfigFileFlow ¶ added in v1.5.0
func NewConfigFileFlow(connector configconnector.ConfigConnector, chain configfilter.Chain, configuration config.Configuration) (*ConfigFileFlow, error)
NewConfigFileFlow 创建配置中心服务
func (*ConfigFileFlow) CreateConfigFile ¶ added in v1.5.5
func (c *ConfigFileFlow) CreateConfigFile(namespace, fileGroup, fileName, content string) error
CreateConfigFile 创建配置文件
func (*ConfigFileFlow) GetConfigFile ¶ added in v1.5.0
func (c *ConfigFileFlow) GetConfigFile(namespace, fileGroup, fileName string) (model.ConfigFile, error)
GetConfigFile 获取配置文件
func (*ConfigFileFlow) PublishConfigFile ¶ added in v1.5.5
func (c *ConfigFileFlow) PublishConfigFile(namespace, fileGroup, fileName string) error
PublishConfigFile 发布配置文件
func (*ConfigFileFlow) UpdateConfigFile ¶ added in v1.5.5
func (c *ConfigFileFlow) UpdateConfigFile(namespace, fileGroup, fileName, content string) error
UpdateConfigFile 更新配置文件
type ConfigFileRepo ¶ added in v1.5.0
type ConfigFileRepo struct {
// contains filtered or unexported fields
}
ConfigFileRepo 服务端配置文件代理类,从服务端拉取配置并同步数据
func (*ConfigFileRepo) AddChangeListener ¶ added in v1.5.0
func (r *ConfigFileRepo) AddChangeListener(listener ConfigFileRepoChangeListener)
AddChangeListener 添加配置文件变更监听器
func (*ConfigFileRepo) GetContent ¶ added in v1.5.0
func (r *ConfigFileRepo) GetContent() string
GetContent 获取配置文件内容
func (*ConfigFileRepo) GetNotifiedVersion ¶ added in v1.5.0
func (r *ConfigFileRepo) GetNotifiedVersion() uint64
type ConfigFileRepoChangeListener ¶ added in v1.5.0
type ConfigFileRepoChangeListener func(configFileMetadata model.ConfigFileMetadata, newContent string) error
ConfigFileRepoChangeListener 远程配置文件发布监听器
type ConfigFlow ¶ added in v1.5.6
type ConfigFlow struct { *ConfigFileFlow *ConfigGroupFlow }
func NewConfigFlow ¶ added in v1.5.6
func NewConfigFlow(connector configconnector.ConfigConnector, chain configfilter.Chain, configuration config.Configuration) (*ConfigFlow, error)
NewConfigFlow 创建配置中心服务
type ConfigGroupFlow ¶ added in v1.5.6
type ConfigGroupFlow struct {
// contains filtered or unexported fields
}
func (*ConfigGroupFlow) GetConfigGroup ¶ added in v1.5.6
func (flow *ConfigGroupFlow) GetConfigGroup(namespace, fileGroup string) (model.ConfigFileGroup, error)
type ConfigGroupRepo ¶ added in v1.5.6
type ConfigGroupRepo struct {
// contains filtered or unexported fields
}
ConfigGroupRepo 服务端配置文件代理类,从服务端拉取配置并同步数据
func (*ConfigGroupRepo) AddChangeListener ¶ added in v1.5.6
func (repo *ConfigGroupRepo) AddChangeListener(listener func(*configconnector.ConfigGroupResponse))
Click to show internal directories.
Click to hide internal directories.