Versions in this module Expand all Collapse all v1 v1.0.2 Apr 16, 2020 Changes in this version + func HTPPAddr(address string) string + func MakeDirAll(dir string) string + type ChangeListener interface + OnChange func(event ConfFileChangeEvent) (string, bool) + type ClientReportItem struct + ConfFile string + Crc string + Msg string + Ok bool + Time string + type ClientReportRspItem struct + AppID string + Bin string + Host string + ID string + Pid string + type Conf struct + func (b *Conf) Name() string + func (b *Conf) Raw() string + func (b *Conf) UpdateRaw(updated string) + type ConfFile interface + ConfFormat func() ConfFmt + Name func() string + Raw func() string + UpdateRaw func(updated string) + func NewConfFile(confFile, raw string) ConfFile + type ConfFileChangeEvent struct + ChangedTime time.Time + ConfFile string + Current string + Old string + type ConfFmt int + const PropertiesFmt + const TxtFmt + func ConfFmtString(s string) (ConfFmt, error) + func ConfFmtValues() []ConfFmt + func (i *ConfFmt) UnmarshalJSON(data []byte) error + func (i ConfFmt) IsAConfFmt() bool + func (i ConfFmt) MarshalJSON() ([]byte, error) + func (i ConfFmt) String() string + type ConfigService struct + func (c *ConfigService) Start(ctx context.Context) + type Context struct + Cache map[string]*FileContent + Client configClient + ConfigServersParsed []string + FileRawChan chan FileRawWait + MetaServersParsed []string + Req *gonet.ReqOption + ReqPoll *gonet.ReqOption + func (c *Context) GetConfigServers() []string + func (c *Context) LoadConfCache(confFile string) *FileContent + func (c *Context) LoadConfFile(confFile string) ConfFile + func (c *Context) UpdateConfigServers(servers []string) bool + func (c *Context) WalkFileContents(fn func(confFile string, fileContext *FileContent)) + type ContextConfig struct + AppID string + ClientKey string + ClientPem string + Cluster string + ConfigReadTimeout time.Duration + ConfigRefreshInterval time.Duration + ConfigServers string + ConnectTimeout time.Duration + DataCenter string + LocalIP string + MetaRefreshInterval time.Duration + MetaServers string + PollingReadTimeout time.Duration + PostAuth string + RetryNetworkSleep time.Duration + RootPem string + ServerType string + SnapshotsDir string + type FileContent struct + type FileRaw struct + AppID string + ConfFile string + Content string + Crc string + type FileRawWait struct + SnapshotIgnore bool + TriggerChangeIgnore bool + Wait chan bool + type MetaService struct + ConfigServersUpdater func(addr []string) + func (m MetaService) Start(ctx context.Context) + func (m MetaService) Try() + type PollingService struct + func (p PollingService) Start(ctx context.Context) + type Prop interface + Bool func(name string) bool + BoolOr func(name string, defaultValue bool) bool + Float32 func(name string) float32 + Float32Or func(name string, defaultValue float32) float32 + Float64 func(name string) float64 + Float64Or func(name string, defaultValue float64) float64 + Int func(name string) int + Int32 func(name string) int32 + Int32Or func(name string, defaultValue int32) int32 + Int64 func(name string) int64 + Int64Or func(name string, defaultValue int64) int64 + IntOr func(name string, defaultValue int) int + Str func(name string) string + StrOr func(name, defaultValue string) string + type PropertiesConfFile struct + Doc *properties.Doc + func NewPropertiesConfFile(confFile, raw string) *PropertiesConfFile + func (p *PropertiesConfFile) Bool(name string) bool + func (p *PropertiesConfFile) BoolOr(name string, defaultValue bool) bool + func (p *PropertiesConfFile) ConfFormat() ConfFmt + func (p *PropertiesConfFile) Float32(name string) float32 + func (p *PropertiesConfFile) Float32Or(name string, defaultValue float32) float32 + func (p *PropertiesConfFile) Float64(name string) float64 + func (p *PropertiesConfFile) Float64Or(name string, defaultValue float64) float64 + func (p *PropertiesConfFile) Int(name string) int + func (p *PropertiesConfFile) Int32(name string) int32 + func (p *PropertiesConfFile) Int32Or(name string, defaultValue int32) int32 + func (p *PropertiesConfFile) Int64(name string) int64 + func (p *PropertiesConfFile) Int64Or(name string, defaultValue int64) int64 + func (p *PropertiesConfFile) IntOr(name string, defaultValue int) int + func (p *PropertiesConfFile) Str(name string) string + func (p *PropertiesConfFile) StrOr(name, defaultValue string) string + type RawConfFile struct + func NewRawConfFile(confFile, raw string) *RawConfFile + func (t *RawConfFile) ConfFormat() ConfFmt + type Runner struct + ConfigService *ConfigService + MetaService *MetaService + PollingService *PollingService + SnapshotService *SnapshotService + func (r *Runner) ConfFile(confFile string) (ConfFile, error) + func (r *Runner) ConsumeChan() + func (r *Runner) ListenerResults(confFile, crc string) ([]ClientReportRspItem, error) + func (r *Runner) PostConf(confFile, raw, clientIps string) (string, error) + func (r *Runner) Properties(confFile string) (*PropertiesConfFile, error) + func (r *Runner) Register(filename string, l ChangeListener) + func (r *Runner) Start() + func (r *Runner) Stop() + func (r *Runner) Unregister(filename string, listener ChangeListener) int + func (r *Runner) UnregisterAll(filename string) + type SnapshotService struct + func (s SnapshotService) Clear(confFile string) error + func (s SnapshotService) Load(file string) error + func (s SnapshotService) LoadMeta() string + func (s SnapshotService) Save(confFile, content string) + func (s SnapshotService) SaveMeta(configServerUrls []string) + func (s SnapshotService) SaveUpdates(fcs []FileContent)