api

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrStoreNotExists = errors.New("store not exists")

ErrStoreNotExists represents the store not exists.

Functions

This section is empty.

Types

type PDClient

type PDClient struct {
	// contains filtered or unexported fields
}

PDClient is an HTTP client of the PD server

func NewPDClient

func NewPDClient(addrs []string, timeout time.Duration, tlsConfig *tls.Config) *PDClient

NewPDClient returns a new PDClient

func (*PDClient) DelStore

func (pc *PDClient) DelStore(host string, retryOpt *utils.RetryOption) error

DelStore deletes stores from a (TiKV) host The host parameter should be in format of IP:Port, that matches store's address

func (*PDClient) GetReplicateConfig

func (pc *PDClient) GetReplicateConfig() ([]byte, error)

GetReplicateConfig gets the PD replicate config

func (*PDClient) GetStores

func (pc *PDClient) GetStores() (*pdserverapi.StoresInfo, error)

GetStores queries the stores info from PD server

func (*PDClient) GetURL

func (pc *PDClient) GetURL(addr string) string

GetURL builds the the client URL of PDClient

func (*PDClient) IsUp

func (pc *PDClient) IsUp(host string) (bool, error)

IsUp check if the node is Up state. The host parameter should be in format of IP:Port, that matches store's address

func (*PDClient) UpdateReplicateConfig

func (pc *PDClient) UpdateReplicateConfig(body io.Reader) error

UpdateReplicateConfig updates the PD replicate config

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL