Documentation ¶
Index ¶
Constants ¶
View Source
const (
NotExistedFileContent = string("@@not_existed@@")
)
Variables ¶
This section is empty.
Functions ¶
func InitLongPollingService ¶
func InitLongPollingService(connector configconnector.ConfigConnector)
InitLongPollingService 初始化长轮询服务
Types ¶
type ConfigFileRepo ¶
type ConfigFileRepo struct {
// contains filtered or unexported fields
}
ConfigFileRepo 服务端配置文件代理类,从服务端拉取配置并同步数据
func NewConfigFileRepo ¶
func NewConfigFileRepo(metadata model.ConfigFileMetadata, connector configconnector.ConfigConnector, configuration config.Configuration) (*ConfigFileRepo, error)
NewConfigFileRepo 创建远程配置文件
func (*ConfigFileRepo) AddChangeListener ¶
func (r *ConfigFileRepo) AddChangeListener(listener ConfigFileRepoChangeListener)
AddChangeListener 添加配置文件变更监听器
func (*ConfigFileRepo) GetContent ¶
func (r *ConfigFileRepo) GetContent() string
GetContent 获取配置文件内容
type ConfigFileRepoChangeListener ¶
type ConfigFileRepoChangeListener func(configFileMetadata model.ConfigFileMetadata, newContent string) error
ConfigFileRepoChangeListener 远程配置文件发布监听器
Click to show internal directories.
Click to hide internal directories.