ticdcapi

package
v2.1.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 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 CaptureStatus

type CaptureStatus struct {
	ID      string `json:"id"`
	Version string `json:"version"`
	IsOwner bool   `json:"is_owner"`
}

type Option

type Option func(opt *Options)

func DisableKeepAlives

func DisableKeepAlives() Option

func WithTLS

func WithTLS(cfg *tls.Config) Option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

type Options

type Options struct {
	Timeout           time.Duration
	TLS               *tls.Config
	DisableKeepAlives bool
	// contains filtered or unexported fields
}

type TiCDCClient

type TiCDCClient interface {
	// GetStatus returns ticdc's status
	GetStatus(ctx context.Context) (*CaptureStatus, error)
	// DrainCapture remove capture ownership and moves its tables to other captures.
	// Returns the number of tables in the capture.
	// If there is only one capture, it always return 0.
	DrainCapture(ctx context.Context) (tableCount int, err error)
	// ResignOwner tries to resign ownership from the current capture.
	// Returns true if the capture has already resigned ownership,
	// otherwise caller should retry resign owner.
	// If there is only one capture, it always return true.
	ResignOwner(ctx context.Context) (ok bool, err error)
	// IsHealthy gets the healthy status of TiCDC cluster.
	// Returns true if the TiCDC cluster is healthy.
	IsHealthy(ctx context.Context) (ok bool, err error)
}

TiCDCClient provides TiDB server's APIs used by TiDB Operator. NOTE: Some of these APIs are only available in v6.3.0 or later.

func NewTiCDCClient

func NewTiCDCClient(addr string, opts ...Option) TiCDCClient

NewTiCDCClient returns a new TiCDCClient.

Jump to

Keyboard shortcuts

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