Documentation ¶
Index ¶
- Constants
- func GetApolloConfigCache() *freecache.Cache
- 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 Start() error
- func StartRefreshConfig(component AbsComponent)
- func StartWithLogger(loggerInterface LoggerInterface) error
- type AbsComponent
- type ApolloConfig
- type ApolloConnConfig
- type AppConfig
- type CallBack
- type ChangeEvent
- type ConfigChange
- type ConfigChangeType
- type ConnectConfig
- type LoggerInterface
- type NotifyConfigComponent
Constants ¶
View Source
const FILE = "apolloConfig.json"
Variables ¶
This section is empty.
Functions ¶
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 StartRefreshConfig ¶
func StartRefreshConfig(component AbsComponent)
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 CallBack ¶ added in v1.0.2
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 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()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.