Documentation ¶
Index ¶
- Constants
- func GetBoolValue(key string, defaultValue bool) bool
- func GetFloatValue(key string, defaultValue float64) float64
- func GetIntValue(key string, defaultValue int) int
- func GetStringValue(key string, defaultValue string) string
- func InitCustomConfig(loadAppConfig func() (*AppConfig, error))
- func ListenChangeEvent() <-chan *ChangeEvent
- func SetCache(cacheInterface CacheInterface)
- func SetLogger(loggerInterface LoggerInterface)
- func Start() error
- func StartRefreshConfig(component AbsComponent)
- func StartWithCache(cacheInterface CacheInterface) error
- func StartWithLogger(loggerInterface LoggerInterface) error
- type AbsComponent
- type ApolloConfig
- type ApolloConnConfig
- type AppConfig
- type CacheInterface
- type CallBack
- type ChangeEvent
- type ConfigChange
- type ConfigChangeType
- type ConnectConfig
- type DefaultLogger
- func (this *DefaultLogger) Debug(v ...interface{})
- func (this *DefaultLogger) Debugf(format string, params ...interface{})
- func (this *DefaultLogger) Error(v ...interface{}) error
- func (this *DefaultLogger) Errorf(format string, params ...interface{}) error
- func (this *DefaultLogger) Info(v ...interface{})
- func (this *DefaultLogger) Infof(format string, params ...interface{})
- func (this *DefaultLogger) Warn(v ...interface{}) error
- func (this *DefaultLogger) Warnf(format string, params ...interface{}) error
- type LoggerInterface
- type NotifyConfigComponent
Constants ¶
View Source
const FILE = "apolloConfig.json"
Variables ¶
This section is empty.
Functions ¶
func GetBoolValue ¶
func GetFloatValue ¶
func GetIntValue ¶
func GetStringValue ¶
func InitCustomConfig ¶ added in v1.4.0
init config by custom
func ListenChangeEvent ¶ added in v1.3.0
func ListenChangeEvent() <-chan *ChangeEvent
list config change event
func SetCache ¶ added in v1.8.0
func SetCache(cacheInterface CacheInterface)
func SetLogger ¶ added in v1.8.0
func SetLogger(loggerInterface LoggerInterface)
func StartRefreshConfig ¶
func StartRefreshConfig(component AbsComponent)
func StartWithCache ¶ added in v1.7.0
func StartWithCache(cacheInterface CacheInterface) error
func StartWithLogger ¶ added in v1.1.0
func StartWithLogger(loggerInterface LoggerInterface) error
Types ¶
type AbsComponent ¶
type AbsComponent interface {
Start()
}
type ApolloConfig ¶
type ApolloConfig struct { ApolloConnConfig Configurations map[string]string `json:"configurations"` }
type ApolloConnConfig ¶ added in v0.0.7
type ApolloConnConfig struct { AppId string `json:"appId"` Cluster string `json:"cluster"` NamespaceName string `json:"namespaceName"` ReleaseKey string `json:"releaseKey"` sync.RWMutex }
func GetCurrentApolloConfig ¶
func GetCurrentApolloConfig() *ApolloConnConfig
type AppConfig ¶
type AppConfig struct { AppId string `json:"appId"` Cluster string `json:"cluster"` NamespaceName string `json:"namespaceName"` Ip string `json:"ip"` NextTryConnTime int64 `json:"-"` BackupConfigPath string `json:"backupConfigPath"` }
func GetAppConfig ¶
type CacheInterface ¶ added in v1.7.0
type CacheInterface interface { Set(key, value []byte, expireSeconds int) (err error) EntryCount() (entryCount int64) Get(key []byte) (value []byte, err error) Del(key []byte) (affected bool) NewIterator() *freecache.Iterator TTL(key []byte) (timeLeft uint32, err error) Clear() }
func GetApolloConfigCache ¶ added in v0.0.7
func GetApolloConfigCache() CacheInterface
type ChangeEvent ¶ added in v1.3.0
type ChangeEvent struct { Namespace string Changes map[string]*ConfigChange }
config change event
type ConfigChange ¶ added in v1.3.0
type ConfigChange struct { OldValue string NewValue string ChangeType ConfigChangeType }
type ConfigChangeType ¶ added in v1.3.0
type ConfigChangeType int
config change type
const ( ADDED ConfigChangeType = iota MODIFIED DELETED )
type ConnectConfig ¶ added in v1.0.2
type DefaultLogger ¶ added in v1.8.0
type DefaultLogger struct { }
func (*DefaultLogger) Debug ¶ added in v1.8.0
func (this *DefaultLogger) Debug(v ...interface{})
func (*DefaultLogger) Debugf ¶ added in v1.8.0
func (this *DefaultLogger) Debugf(format string, params ...interface{})
func (*DefaultLogger) Error ¶ added in v1.8.0
func (this *DefaultLogger) Error(v ...interface{}) error
func (*DefaultLogger) Errorf ¶ added in v1.8.0
func (this *DefaultLogger) Errorf(format string, params ...interface{}) error
func (*DefaultLogger) Info ¶ added in v1.8.0
func (this *DefaultLogger) Info(v ...interface{})
func (*DefaultLogger) Infof ¶ added in v1.8.0
func (this *DefaultLogger) Infof(format string, params ...interface{})
func (*DefaultLogger) Warn ¶ added in v1.8.0
func (this *DefaultLogger) Warn(v ...interface{}) error
func (*DefaultLogger) Warnf ¶ added in v1.8.0
func (this *DefaultLogger) Warnf(format string, params ...interface{}) error
type LoggerInterface ¶ added in v1.1.0
type LoggerInterface interface { Debugf(format string, params ...interface{}) Infof(format string, params ...interface{}) Warnf(format string, params ...interface{}) error Errorf(format string, params ...interface{}) error Debug(v ...interface{}) Info(v ...interface{}) Warn(v ...interface{}) error Error(v ...interface{}) error }
type NotifyConfigComponent ¶
type NotifyConfigComponent struct { }
func (*NotifyConfigComponent) Start ¶
func (this *NotifyConfigComponent) Start()
Click to show internal directories.
Click to hide internal directories.