Documentation ¶
Index ¶
- type APIV2Client
- func (c *APIV2Client) Captures() CaptureInterface
- func (c *APIV2Client) Changefeeds() ChangefeedInterface
- func (c *APIV2Client) Processors() ProcessorInterface
- func (c *APIV2Client) RESTClient() rest.CDCRESTInterface
- func (c *APIV2Client) Status() StatusInterface
- func (c *APIV2Client) Tso() TsoInterface
- func (c *APIV2Client) Unsafe() UnsafeInterface
- type APIV2Interface
- type CaptureInterface
- type CapturesGetter
- type ChangefeedInterface
- type ChangefeedsGetter
- type ProcessorInterface
- type ProcessorsGetter
- type StatusGetter
- type StatusInterface
- type TsoGetter
- type TsoInterface
- type UnsafeGetter
- type UnsafeInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIV2Client ¶
type APIV2Client struct {
// contains filtered or unexported fields
}
APIV2Client implements APIV1Interface and it is used to interact with cdc owner http api.
func NewAPIClient ¶
func NewAPIClient(serverAddr string, credential *security.Credential, values url.Values) (*APIV2Client, error)
NewAPIClient creates a new APIV1Client.
func (*APIV2Client) Captures ¶
func (c *APIV2Client) Captures() CaptureInterface
Captures returns a CaptureInterface which abstracts capture operations.
func (*APIV2Client) Changefeeds ¶
func (c *APIV2Client) Changefeeds() ChangefeedInterface
Changefeeds returns a ChangefeedInterface with cdc api
func (*APIV2Client) Processors ¶
func (c *APIV2Client) Processors() ProcessorInterface
Processors returns a ProcessorInterface abstracting processor operations.
func (*APIV2Client) RESTClient ¶
func (c *APIV2Client) RESTClient() rest.CDCRESTInterface
RESTClient returns a RESTClient that is used to communicate with owner api by this client implementation.
func (*APIV2Client) Status ¶
func (c *APIV2Client) Status() StatusInterface
Status returns a StatusInterface to communicate with cdc api
func (*APIV2Client) Tso ¶
func (c *APIV2Client) Tso() TsoInterface
Tso returns a TsoInterface to communicate with cdc api
func (*APIV2Client) Unsafe ¶
func (c *APIV2Client) Unsafe() UnsafeInterface
Unsafe returns a UnsafeInterface to communicate with cdc api
type APIV2Interface ¶
type APIV2Interface interface { RESTClient() rest.CDCRESTInterface ChangefeedsGetter TsoGetter UnsafeGetter StatusGetter CapturesGetter ProcessorsGetter }
APIV2Interface 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 ¶
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 { // Create creates a changefeed Create(ctx context.Context, cfg *v2.ChangefeedConfig) (*v2.ChangeFeedInfo, error) // VerifyTable verifies table for a changefeed VerifyTable(ctx context.Context, cfg *v2.VerifyTableConfig) (*v2.Tables, error) // Update updates a changefeed Update(ctx context.Context, cfg *v2.ChangefeedConfig, namespace string, name string) (*v2.ChangeFeedInfo, error) // Resume resumes a changefeed with given config Resume(ctx context.Context, cfg *v2.ResumeChangefeedConfig, namespace string, name string) error // Delete deletes a changefeed by name Delete(ctx context.Context, namespace string, name string) error // Pause pauses a changefeed with given name Pause(ctx context.Context, namespace string, name string) error // Get gets a changefeed detaail info Get(ctx context.Context, namespace string, name string) (*v2.ChangeFeedInfo, error) // List lists all changefeeds List(ctx context.Context, namespace string, state string) ([]v2.ChangefeedCommonInfo, error) }
ChangefeedInterface has methods to work with Changefeed items. We can also mock the changefeed operations by implement this interface.
type ChangefeedsGetter ¶
type ChangefeedsGetter interface {
Changefeeds() ChangefeedInterface
}
ChangefeedsGetter has a method to return a ChangefeedInterface.
type ProcessorInterface ¶
type ProcessorInterface interface { Get(ctx context.Context, namespace string, changefeedID, captureID string) (*v2.ProcessorDetail, error) List(ctx context.Context) ([]v2.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.
type StatusGetter ¶
type StatusGetter interface {
Status() StatusInterface
}
StatusGetter has a method to return a StatusInterface.
type StatusInterface ¶
type StatusInterface interface {
Get(ctx context.Context) (*model.ServerStatus, error)
}
StatusInterface has methods to work with status api
type TsoGetter ¶
type TsoGetter interface {
Tso() TsoInterface
}
TsoGetter has a method to return a StatusInterface.
type TsoInterface ¶
type TsoInterface interface {
Query(ctx context.Context, config *v2.UpstreamConfig) (*v2.Tso, error)
}
TsoInterface has methods to work with status api
type UnsafeGetter ¶
type UnsafeGetter interface {
Unsafe() UnsafeInterface
}
UnsafeGetter has a method to return a UnsafeInterface.
type UnsafeInterface ¶
type UnsafeInterface interface { Metadata(ctx context.Context) (*[]v2.EtcdData, error) ResolveLock(ctx context.Context, req *v2.ResolveLockReq) error DeleteServiceGcSafePoint(ctx context.Context, config *v2.UpstreamConfig) error }
UnsafeInterface has methods to work with unsafe api