Documentation ¶
Overview ¶
Package pdclient provides a flexible PD API access to any PD instance.
Index ¶
- func NewEtcdClient(config EtcdClientConfig) (*clientv3.Client, error)
- type APIClient
- func (api *APIClient) GetConfigReplicate() (*GetConfigReplicateResponse, error)
- func (api *APIClient) GetHealth() (*GetHealthResponse, error)
- func (api *APIClient) GetMembers() (*GetMembersResponse, error)
- func (api *APIClient) GetStatus() (*GetStatusResponse, error)
- func (api *APIClient) GetStores() (*GetStoresResponse, error)
- func (api *APIClient) HLGetLocationLabels() ([]string, error)
- func (api *APIClient) HLGetStoreLocations() (*StoreLocations, error)
- func (api *APIClient) HLGetStores() ([]GetStoresResponseStore, error)
- type EtcdClientConfig
- type GetConfigReplicateResponse
- type GetHealthResponse
- type GetMembersResponse
- type GetStatusResponse
- type GetStoresResponse
- type GetStoresResponseStore
- type StoreLabels
- type StoreLocations
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEtcdClient ¶
func NewEtcdClient(config EtcdClientConfig) (*clientv3.Client, error)
NewEtcdClient creates a new etcd client. The client must be closed by calling `client.Close()`. Returns error when config is invalid.
Types ¶
type APIClient ¶
type APIClient struct {
*httpclient.Client
}
func NewAPIClient ¶
func NewAPIClient(config httpclient.APIClientConfig) (*APIClient, error)
Returns error when config is invalid.
func (*APIClient) GetConfigReplicate ¶
func (api *APIClient) GetConfigReplicate() (*GetConfigReplicateResponse, error)
func (*APIClient) GetHealth ¶
func (api *APIClient) GetHealth() (*GetHealthResponse, error)
func (*APIClient) GetMembers ¶
func (api *APIClient) GetMembers() (*GetMembersResponse, error)
func (*APIClient) GetStatus ¶
func (api *APIClient) GetStatus() (*GetStatusResponse, error)
func (*APIClient) GetStores ¶
func (api *APIClient) GetStores() (*GetStoresResponse, error)
func (*APIClient) HLGetLocationLabels ¶
func (*APIClient) HLGetStoreLocations ¶
func (api *APIClient) HLGetStoreLocations() (*StoreLocations, error)
func (*APIClient) HLGetStores ¶
func (api *APIClient) HLGetStores() ([]GetStoresResponseStore, error)
type EtcdClientConfig ¶
type GetConfigReplicateResponse ¶
type GetConfigReplicateResponse struct {
LocationLabels string `json:"location-labels"`
}
type GetHealthResponse ¶
type GetMembersResponse ¶
type GetStatusResponse ¶
type GetStatusResponse struct {
StartTimestamp int64 `json:"start_timestamp"`
}
type GetStoresResponse ¶
type GetStoresResponse struct { Stores []struct { Store GetStoresResponseStore } `json:"stores"` }
type GetStoresResponseStore ¶
type GetStoresResponseStore struct { Address string `json:"address"` ID int `json:"id"` Labels []struct { Key string `json:"key"` Value string `json:"value"` } `json:"labels"` StateName string `json:"state_name"` Version string `json:"version"` StatusAddress string `json:"status_address"` GitHash string `json:"git_hash"` DeployPath string `json:"deploy_path"` StartTimestamp int64 `json:"start_timestamp"` }
type StoreLabels ¶
type StoreLocations ¶
type StoreLocations struct { LocationLabels []string `json:"location_labels"` Stores []StoreLabels `json:"stores"` }
Click to show internal directories.
Click to hide internal directories.