v1

package
v0.0.0-...-a345a4b Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIV1Client

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

APIV1Client implements APIV1Interface and it is used to interact with cdc owner http api.

func NewAPIClient

func NewAPIClient(ownerAddr string, credential *security.Credential) (*APIV1Client, error)

NewAPIClient creates a new APIV1Client.

func (*APIV1Client) Captures

func (c *APIV1Client) Captures() CaptureInterface

Captures returns a CaptureInterface which abstracts capture operations.

func (*APIV1Client) Changefeeds

func (c *APIV1Client) Changefeeds() ChangefeedInterface

Changefeeds returns a ChangefeedInterface which abstracts changefeed operations.

func (*APIV1Client) Processors

func (c *APIV1Client) Processors() ProcessorInterface

Processors returns a ProcessorInterface which abstracts processor operations.

func (*APIV1Client) RESTClient

func (c *APIV1Client) RESTClient() rest.CDCRESTInterface

RESTClient returns a RESTClient that is used to communicate with owner api by this client implementation.

type APIV1Interface

type APIV1Interface interface {
	RESTClient() rest.CDCRESTInterface
	CapturesGetter
	ChangefeedsGetter
	ProcessorsGetter
}

APIV1Interface is an abstraction for TiCDC capture/changefeed/processor operations. We can create a fake api client which mocks TiCDC operations by implement this interface.

type CaptureInterface

type CaptureInterface interface {
	List(ctx context.Context) (*[]model.Capture, error)
}

CaptureInterface has methods to work with Capture items. We can also mock the capture operations by implement this interface.

type CapturesGetter

type CapturesGetter interface {
	Captures() CaptureInterface
}

CapturesGetter has a method to return a CaptureInterface.

type ChangefeedInterface

type ChangefeedInterface interface {
	Get(ctx context.Context, name string) (*model.ChangefeedDetail, error)
	List(ctx context.Context) (*[]model.ChangeFeedInfo, error)
}

ChangefeedInterface has methods to work with Changfeed items. We can also mock the changefeed operations by implement this interface.

type ChangefeedsGetter

type ChangefeedsGetter interface {
	Changefeeds() ChangefeedInterface
}

ChangfeedGetter has a method to return a ChangfeedInterface.

type ProcessorInterface

type ProcessorInterface interface {
	Get(ctx context.Context, changefeedID, captureID string) (*model.ProcessorDetail, error)
	List(ctx context.Context) (*[]model.ProcessorCommonInfo, error)
}

ProcessorInterface has methods to work with Processor items. We can also mock the processor operations by implement this interface.

type ProcessorsGetter

type ProcessorsGetter interface {
	Processors() ProcessorInterface
}

ProcessorsGetter has a method to return a ProcessorInterface.

Jump to

Keyboard shortcuts

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