binlog

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {

	// if setted, will call HookAddr to change the address of pump/drainer
	// before accessing pump/drainer.
	HookAddr func(addr string) (changedAddr string)
	// contains filtered or unexported fields
}

Client is the client of binlog.

func NewBinlogClient

func NewBinlogClient(pdEndpoint []string, tlsConfig *tls.Config) (*Client, error)

NewBinlogClient create a Client.

func (*Client) Close

func (c *Client) Close() error

Close the client.

func (*Client) IsDrainerTombstone

func (c *Client) IsDrainerTombstone(ctx context.Context, addr string) (bool, error)

IsDrainerTombstone check if drainer is tombstone.

func (*Client) IsPumpTombstone

func (c *Client) IsPumpTombstone(ctx context.Context, addr string) (bool, error)

IsPumpTombstone check if drainer is tombstone.

func (*Client) OfflineDrainer

func (c *Client) OfflineDrainer(ctx context.Context, addr string) error

OfflineDrainer offline a drainer.

func (*Client) OfflinePump

func (c *Client) OfflinePump(ctx context.Context, addr string) error

OfflinePump offline a pump.

func (*Client) PumpNodeStatus

func (c *Client) PumpNodeStatus(ctx context.Context) (status []*NodeStatus, err error)

func (*Client) UpdateDrainerState

func (c *Client) UpdateDrainerState(ctx context.Context, addr string, state string) error

UpdateDrainerState update the specify state as the specified state.

func (*Client) UpdatePumpState

func (c *Client) UpdatePumpState(ctx context.Context, addr string, state string) error

UpdatePumpState update the specify state as the specified state.

type NodeStatus

type NodeStatus struct {
	NodeID string `json:"nodeId"`
	Host   string `json:"host"`
	State  string `json:"state"`
}

NodeStatus represents the status saved in etcd.

type StatusResp

type StatusResp struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

StatusResp represents the response of status api.

Jump to

Keyboard shortcuts

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