binlog

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 11 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, timeout time.Duration) (*Client, error)

NewBinlogClient create a Client and return an error if the underlying conn is not up within timeout duration.

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 []*v1alpha1.PumpNodeStatus, 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 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