Documentation ¶
Overview ¶
Package memberdiscovery created on 2017/6/20.
Index ¶
- Constants
- Variables
- func GetConfigs(actionData []byte) (map[string]interface{}, error)
- func GetDefaultHeaders(tenantName string) http.Header
- func NewConfigCenter(options config.Options) config.Client
- type Client
- func (cclient *Client) DeleteConfigsByKeys(keys []string, dimensionInfo string) (map[string]interface{}, error)
- func (cclient *Client) PullConfig(serviceName, version, app, env, key, contentType string) (interface{}, error)
- func (cclient *Client) PullConfigs(serviceName, version, app, env string) (map[string]interface{}, error)
- func (cclient *Client) PullConfigsByDI(dimensionInfo, diInfo string) (map[string]map[string]interface{}, error)
- func (cclient *Client) PushConfigs(items map[string]interface{}, dimensionInfo string) (map[string]interface{}, error)
- func (cclient *Client) Watch(f func(map[string]interface{}), errHandler func(err error)) error
- type CreateConfigApi
- type DeleteConfigApi
- type Event
- type Instance
- type MemDiscovery
- func (memDis *MemDiscovery) ConfigurationInit(initConfigServer []string) error
- func (memDis *MemDiscovery) GetConfigServer() ([]string, error)
- func (memDis *MemDiscovery) GetWorkingConfigCenterIP(entryPoint []string) ([]string, error)
- func (memDis *MemDiscovery) HTTPDo(method string, rawURL string, headers http.Header, body []byte) (resp *http.Response, err error)
- func (memDis *MemDiscovery) RefreshMembers() error
- func (memDis *MemDiscovery) Shuffle() error
- type MemberDiscovery
- type Members
Constants ¶
const ( //StatusUP is a variable of type string StatusUP = "UP" //HeaderContentType is a variable of type string HeaderContentType = "Content-Type" //HeaderUserAgent is a variable of type string HeaderUserAgent = "User-Agent" //HeaderEnvironment specifies the environment of a service HeaderEnvironment = "X-Environment" // Name of the Plugin Name = "config_center" )
Variables ¶
var ( //HeaderTenantName is a variable of type string HeaderTenantName = "X-Tenant-Name" //ConfigMembersPath is a variable of type string ConfigMembersPath = "" //ConfigPath is a variable of type string ConfigPath = "" //ConfigRefreshPath is a variable of type string ConfigRefreshPath = "" //MemberDiscoveryService is a variable MemberDiscoveryService MemberDiscovery )
Functions ¶
func GetConfigs ¶ added in v0.3.0
GetConfigs get KV from a event
func GetDefaultHeaders ¶
GetDefaultHeaders gets default headers
func NewConfigCenter ¶
func NewConfigCenter(options config.Options) config.Client
NewConfigCenter is a function
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is Client Implementation of Client
func (*Client) DeleteConfigsByKeys ¶
func (cclient *Client) DeleteConfigsByKeys(keys []string, dimensionInfo string) (map[string]interface{}, error)
DeleteConfigsByKeys
func (*Client) PullConfig ¶
func (cclient *Client) PullConfig(serviceName, version, app, env, key, contentType string) (interface{}, error)
PullConfig is the implementation of Client to pull specific configurations from Config-Server
func (*Client) PullConfigs ¶
func (cclient *Client) PullConfigs(serviceName, version, app, env string) (map[string]interface{}, error)
PullConfigs is the implementation of Client to pull all the configurations from Config-Server
func (*Client) PullConfigsByDI ¶
func (cclient *Client) PullConfigsByDI(dimensionInfo, diInfo string) (map[string]map[string]interface{}, error)
PullConfigsByDI pulls the configuration for custom DimensionInfo
type CreateConfigApi ¶ added in v0.3.0
type DeleteConfigApi ¶ added in v0.3.0
type Instance ¶
type Instance struct { Status string `json:"status"` ServiceName string `json:"serviceName"` IsHTTPS bool `json:"isHttps"` EntryPoints []string `json:"endpoints"` }
Instance is a struct
type MemDiscovery ¶
type MemDiscovery struct { ConfigServerAddresses []string //Logger *log.Entry IsInit bool TLSConfig *tls.Config TenantName string EnableSSL bool sync.RWMutex // contains filtered or unexported fields }
MemDiscovery is a struct
func (*MemDiscovery) ConfigurationInit ¶
func (memDis *MemDiscovery) ConfigurationInit(initConfigServer []string) error
ConfigurationInit is a method for creating a configuration
func (*MemDiscovery) GetConfigServer ¶
func (memDis *MemDiscovery) GetConfigServer() ([]string, error)
GetConfigServer is a method used for getting server configuration
func (*MemDiscovery) GetWorkingConfigCenterIP ¶
func (memDis *MemDiscovery) GetWorkingConfigCenterIP(entryPoint []string) ([]string, error)
GetWorkingConfigCenterIP is a method which gets working configuration center IP
func (*MemDiscovery) HTTPDo ¶
func (memDis *MemDiscovery) HTTPDo(method string, rawURL string, headers http.Header, body []byte) (resp *http.Response, err error)
HTTPDo Use http-client package for rest communication
func (*MemDiscovery) RefreshMembers ¶
func (memDis *MemDiscovery) RefreshMembers() error
RefreshMembers is a method
func (*MemDiscovery) Shuffle ¶
func (memDis *MemDiscovery) Shuffle() error
Shuffle is a method to log error