Documentation
¶
Index ¶
- type AddConfReq
- type AddConfResp
- type ApolloApiClient
- func (c *ApolloApiClient) AddConf(env, appId, clusterName, namespace, key, value string) (*AddConfResp, error)
- func (c *ApolloApiClient) DeleteConf(env, appId, clusterName, namespace, key string) error
- func (c *ApolloApiClient) GetConf(env, appId, clusterName, namespace, key string) (*GetConfResp, error)
- func (c *ApolloApiClient) GetNameSpaceInfo(env, appId, clusterName, namespace string) (*NameSpaceInfoResp, error)
- func (c *ApolloApiClient) GetReleasedConf(env, appId, clusterName, namespace string) (*GetReleasedConfResp, error)
- func (c *ApolloApiClient) ReleaseConf(env, appId, clusterName, namespace string) (*ReleaseConfResp, error)
- func (c *ApolloApiClient) UpdateConf(env, appId, clusterName, namespace, key, value string) error
- type ApolloCache
- type ApolloClient
- func (c *ApolloClient) AutoSync(duration time.Duration) error
- func (c *ApolloClient) DeleteKey(key string)
- func (c *ApolloClient) GetCache() *ApolloCache
- func (c *ApolloClient) GetKey(key string) (string, bool)
- func (c *ApolloClient) SetConf(conf ApolloConfig)
- func (c *ApolloClient) SetKey(key, value string)
- func (c *ApolloClient) StopAutoSync()
- func (c *ApolloClient) Sync() error
- func (c *ApolloClient) SyncFromRemote() error
- func (c *ApolloClient) UpdateKey(key, value string)
- type ApolloConfig
- type GetConfResp
- type GetReleasedConfResp
- type NameSpaceInfoResp
- type ReleaseConfReq
- type ReleaseConfResp
- type UpdateConfReq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddConfReq ¶
type AddConfResp ¶
type AddConfResp struct { Key string `json:"key"` Value string `json:"value"` Comment string `json:"comment"` DataChangeCreatedBy string `json:"dataChangeCreatedBy"` DataChangeLastModifiedBy string `json:"dataChangeLastModifiedBy"` DataChangeCreatedTime string `json:"dataChangeCreatedTime"` DataChangeLastModifiedTime string `json:"dataChangeLastModifiedTime"` }
type ApolloApiClient ¶
type ApolloApiClient struct {
// contains filtered or unexported fields
}
func NewApolloApiClient ¶
func NewApolloApiClient(resty *resty.Client, creator string) *ApolloApiClient
func (*ApolloApiClient) AddConf ¶
func (c *ApolloApiClient) AddConf(env, appId, clusterName, namespace, key, value string) (*AddConfResp, error)
func (*ApolloApiClient) DeleteConf ¶
func (c *ApolloApiClient) DeleteConf(env, appId, clusterName, namespace, key string) error
func (*ApolloApiClient) GetConf ¶
func (c *ApolloApiClient) GetConf(env, appId, clusterName, namespace, key string) (*GetConfResp, error)
func (*ApolloApiClient) GetNameSpaceInfo ¶
func (c *ApolloApiClient) GetNameSpaceInfo(env, appId, clusterName, namespace string) (*NameSpaceInfoResp, error)
func (*ApolloApiClient) GetReleasedConf ¶
func (c *ApolloApiClient) GetReleasedConf(env, appId, clusterName, namespace string) (*GetReleasedConfResp, error)
func (*ApolloApiClient) ReleaseConf ¶
func (c *ApolloApiClient) ReleaseConf(env, appId, clusterName, namespace string) (*ReleaseConfResp, error)
func (*ApolloApiClient) UpdateConf ¶
func (c *ApolloApiClient) UpdateConf(env, appId, clusterName, namespace, key, value string) error
type ApolloCache ¶
type ApolloCache struct {
// contains filtered or unexported fields
}
func NewApolloCache ¶
func NewApolloCache() *ApolloCache
func (*ApolloCache) Delete ¶
func (c *ApolloCache) Delete(key string)
func (*ApolloCache) Range ¶
func (c *ApolloCache) Range(rangeFunc func(key, value string) bool)
func (*ApolloCache) Set ¶
func (c *ApolloCache) Set(key string, value string)
type ApolloClient ¶
type ApolloClient struct { Conf ApolloConfig // contains filtered or unexported fields }
ApolloClient an apollo client sync local to remote
func NewApolloClient ¶
func NewApolloClient(conf ApolloConfig, creator string) (*ApolloClient, error)
NewApolloClient create a apollo client
func (*ApolloClient) AutoSync ¶
func (c *ApolloClient) AutoSync(duration time.Duration) error
AutoSync this will start auto sync, call AutoSync function every interval
func (*ApolloClient) DeleteKey ¶
func (c *ApolloClient) DeleteKey(key string)
DeleteKey delete key from cache
func (*ApolloClient) GetCache ¶
func (c *ApolloClient) GetCache() *ApolloCache
GetCache GetKeys get local cache
func (*ApolloClient) GetKey ¶
func (c *ApolloClient) GetKey(key string) (string, bool)
GetKey get key value from cache
func (*ApolloClient) SetConf ¶
func (c *ApolloClient) SetConf(conf ApolloConfig)
SetConf set apollo config
func (*ApolloClient) SetKey ¶
func (c *ApolloClient) SetKey(key, value string)
SetKey set key value to cache
func (*ApolloClient) StopAutoSync ¶
func (c *ApolloClient) StopAutoSync()
StopAutoSync this will stop auto sync
func (*ApolloClient) Sync ¶
func (c *ApolloClient) Sync() error
Sync this will sync local cache to remote
func (*ApolloClient) SyncFromRemote ¶
func (c *ApolloClient) SyncFromRemote() error
SyncFromRemote this will sync the cache from remote
func (*ApolloClient) UpdateKey ¶
func (c *ApolloClient) UpdateKey(key, value string)
UpdateKey update key value to cache
type ApolloConfig ¶
type GetConfResp ¶
type GetConfResp struct { Key string `json:"key"` Value string `json:"value"` Comment string `json:"comment"` DataChangeCreatedBy string `json:"dataChangeCreatedBy"` DataChangeLastModifiedBy string `json:"dataChangeLastModifiedBy"` DataChangeCreatedTime string `json:"dataChangeCreatedTime"` DataChangeLastModifiedTime string `json:"dataChangeLastModifiedTime"` }
type GetReleasedConfResp ¶
type GetReleasedConfResp struct { AppId string `json:"appId"` ClusterName string `json:"clusterName"` NamespaceName string `json:"namespaceName"` Name string `json:"name"` Configurations map[string]interface{} `json:"configurations"` Comment string `json:"comment"` DataChangeCreatedBy string `json:"dataChangeCreatedBy"` DataChangeLastModifiedBy string `json:"dataChangeLastModifiedBy"` DataChangeCreatedTime string `json:"dataChangeCreatedTime"` DataChangeLastModifiedTime string `json:"dataChangeLastModifiedTime"` }
type NameSpaceInfoResp ¶
type NameSpaceInfoResp struct { AppId string `json:"appId"` ClusterName string `json:"clusterName"` NamespaceName string `json:"namespaceName"` Comment string `json:"comment"` Format string `json:"format"` IsPublic bool `json:"isPublic"` Items []struct { Key string `json:"key"` Value string `json:"value"` DataChangeCreatedBy string `json:"dataChangeCreatedBy"` DataChangeLastModifiedBy string `json:"dataChangeLastModifiedBy"` DataChangeCreatedTime string `json:"dataChangeCreatedTime"` DataChangeLastModifiedTime string `json:"dataChangeLastModifiedTime"` } `json:"items"` DataChangeCreatedBy string `json:"dataChangeCreatedBy"` DataChangeLastModifiedBy string `json:"dataChangeLastModifiedBy"` DataChangeCreatedTime string `json:"dataChangeCreatedTime"` DataChangeLastModifiedTime string `json:"dataChangeLastModifiedTime"` }
type ReleaseConfReq ¶
type ReleaseConfResp ¶
type ReleaseConfResp struct { AppId string `json:"appId"` ClusterName string `json:"clusterName"` NamespaceName string `json:"namespaceName"` Name string `json:"name"` Configurations map[string]interface{} `json:"configurations"` Comment string `json:"comment"` DataChangeCreatedBy string `json:"dataChangeCreatedBy"` DataChangeLastModifiedBy string `json:"dataChangeLastModifiedBy"` DataChangeCreatedTime string `json:"dataChangeCreatedTime"` DataChangeLastModifiedTime string `json:"dataChangeLastModifiedTime"` }
Click to show internal directories.
Click to hide internal directories.