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(ctx context.Context, component AbsComponent)
- func StartWith(ctx context.Context, loggerInterface LoggerInterface) error
- func StartWithLogger(ctx context.Context, 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 GetApolloConfigCache ¶ added in v0.0.7
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 StartRefreshConfig ¶
func StartRefreshConfig(ctx context.Context, component AbsComponent)
func StartWith ¶ added in v1.6.5
func StartWith(ctx context.Context, loggerInterface LoggerInterface) error
func StartWithLogger ¶ added in v1.1.0
func StartWithLogger(ctx context.Context, loggerInterface LoggerInterface) error
Types ¶
type AbsComponent ¶
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 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(ctx context.Context)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.