Documentation ¶
Index ¶
- Variables
- func SplitNamespaces(namespacesStr string, callback func(namespace string)) sync.Map
- type ApolloConfig
- type ApolloConnConfig
- type AppConfig
- func (a *AppConfig) GetBackupConfigPath() string
- func (a *AppConfig) GetCurrentApolloConfig() *CurrentApolloConfig
- func (a *AppConfig) GetHost() string
- func (a *AppConfig) GetIsBackupConfig() bool
- func (a *AppConfig) GetNotificationsMap() *notificationsMap
- func (a *AppConfig) GetServicesConfigURL() string
- func (a *AppConfig) Init()
- func (a *AppConfig) SetCurrentApolloConfig(apolloConfig *ApolloConnConfig)
- type CurrentApolloConfig
- type File
- type Notification
- type ServerInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Comma = ","
)
Functions ¶
Types ¶
type ApolloConfig ¶
type ApolloConfig struct { ApolloConnConfig Configurations map[string]interface{} `json:"configurations"` }
ApolloConfig apollo配置
type ApolloConnConfig ¶
type ApolloConnConfig struct { AppID string `json:"appId"` Cluster string `json:"cluster"` NamespaceName string `json:"namespaceName"` ReleaseKey string `json:"releaseKey"` sync.RWMutex }
ApolloConnConfig apollo链接配置
type AppConfig ¶
type AppConfig struct { AppID string `json:"appId"` Cluster string `json:"cluster"` NamespaceName string `json:"namespaceName"` IP string `json:"ip"` IsBackupConfig bool `default:"true" json:"isBackupConfig"` BackupConfigPath string `json:"backupConfigPath"` Secret string `json:"secret"` Label string `json:"label"` SyncServerTimeout int `json:"syncServerTimeout"` // MustStart 可用于控制第一次同步必须成功 MustStart bool `default:"false"` // contains filtered or unexported fields }
AppConfig 配置文件
func (*AppConfig) GetBackupConfigPath ¶
GetBackupConfigPath GetBackupConfigPath
func (*AppConfig) GetCurrentApolloConfig ¶
func (a *AppConfig) GetCurrentApolloConfig() *CurrentApolloConfig
GetCurrentApolloConfig nolint
func (*AppConfig) GetIsBackupConfig ¶
GetIsBackupConfig whether backup config after fetch config from apollo false : no true : yes (default)
func (*AppConfig) GetNotificationsMap ¶
func (a *AppConfig) GetNotificationsMap() *notificationsMap
GetNotificationsMap 获取notificationsMap
func (*AppConfig) GetServicesConfigURL ¶
GetServicesConfigURL 获取服务器列表url
func (*AppConfig) SetCurrentApolloConfig ¶
func (a *AppConfig) SetCurrentApolloConfig(apolloConfig *ApolloConnConfig)
SetCurrentApolloConfig nolint
type CurrentApolloConfig ¶
type CurrentApolloConfig struct {
// contains filtered or unexported fields
}
CurrentApolloConfig 当前 apollo 返回的配置信息
func CreateCurrentApolloConfig ¶
func CreateCurrentApolloConfig() *CurrentApolloConfig
CreateCurrentApolloConfig nolint
func (*CurrentApolloConfig) Get ¶
func (c *CurrentApolloConfig) Get() map[string]*ApolloConnConfig
GetCurrentApolloConfig 获取Apollo链接配置
func (*CurrentApolloConfig) GetReleaseKey ¶
func (c *CurrentApolloConfig) GetReleaseKey(namespace string) string
GetCurrentApolloConfigReleaseKey 获取release key
func (*CurrentApolloConfig) Set ¶
func (c *CurrentApolloConfig) Set(namespace string, connConfig *ApolloConnConfig)
SetCurrentApolloConfig 设置apollo配置
type File ¶
type File interface { Load(fileName string, unmarshal func([]byte) (interface{}, error)) (interface{}, error) Write(content interface{}, configPath string) error }
File 读写配置文件
type Notification ¶
type Notification struct { NamespaceName string `json:"namespaceName"` NotificationID int64 `json:"notificationId"` }
Notification 用于保存 apollo Notification 信息
Click to show internal directories.
Click to hide internal directories.