Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigObserver ¶
type ConfigObserver struct { ReloadInterval int // 检查远程配置的时间间隔,秒 // contains filtered or unexported fields }
ConfigObserver Taf远程配置监听服务
func NewObserver ¶
func NewObserver(reloadInterval int, path string) *ConfigObserver
NewObserver 根据服务配置,初始化一个observer (每个App/Server只需要调用1次)
reload_interval - 检查远程配置变更的时间,建议值:60 (60秒)。可通过ReloadInterval动态调整 path - 传空字符串""则默认写入到`conf/`
func (*ConfigObserver) AddRemoteConfig ¶
func (cob *ConfigObserver) AddRemoteConfig(filename string) (vpconf *viper.Viper, err error)
AddRemoteConfig 新增一个要监听的远程配置
func (*ConfigObserver) GetCRC32 ¶
func (cob *ConfigObserver) GetCRC32(filename string) uint32
GetCRC32 返回目标文件的CRC32
Click to show internal directories.
Click to hide internal directories.