api

package
v0.0.0-...-4624acb Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// OpVarAdminJob is the key of admin job in HTTP API
	OpVarAdminJob = "admin-job"
	// OpVarChangefeedID is the key of changefeed ID in HTTP API
	OpVarChangefeedID = "cf-id"
	// OpVarTargetCaptureID is the key of to-capture ID in HTTP API
	OpVarTargetCaptureID = "target-cp-id"
	// OpVarTableID is the key of table ID in HTTP API
	OpVarTableID = "table-id"

	// APIOpVarChangefeedState is the key of changefeed state in HTTP API.
	APIOpVarChangefeedState = "state"
	// APIOpVarChangefeedID is the key of changefeed ID in HTTP API.
	APIOpVarChangefeedID = "changefeed_id"
	// APIOpVarCaptureID is the key of capture ID in HTTP API.
	APIOpVarCaptureID = "capture_id"
	// APIOpVarNamespace is the key of changefeed namespace in HTTP API.
	APIOpVarNamespace = "namespace"
	// APIOpVarTiCDCUser is the key of ticdc user in HTTP API.
	APIOpVarTiCDCUser = "user"
	// APIOpVarTiCDCPassword is the key of ticdc password in HTTP API.
	APIOpVarTiCDCPassword = "password"
)

Variables

This section is empty.

Functions

func ForwardToCapture

func ForwardToCapture(c *gin.Context, fromID, toAddr string)

ForwardToCapture forward request to another

func ForwardToOwner

func ForwardToOwner(c *gin.Context, p capture.Capture)

ForwardToOwner forwards a request to the controller

func HandleOwnerBalance

func HandleOwnerBalance(
	ctx context.Context, capture capture.Capture, changefeedID model.ChangeFeedID,
) error

HandleOwnerBalance balance the changefeed tables

func HandleOwnerDrainCapture

func HandleOwnerDrainCapture(
	ctx context.Context, capture capture.Capture, captureID string,
) (*model.DrainCaptureResp, error)

HandleOwnerDrainCapture schedule drain the target capture

func HandleOwnerJob

func HandleOwnerJob(
	ctx context.Context, capture capture.Capture, job model.AdminJob,
) error

HandleOwnerJob enqueue the admin job

func HandleOwnerScheduleTable

func HandleOwnerScheduleTable(
	ctx context.Context, capture capture.Capture,
	changefeedID model.ChangeFeedID, captureID string, tableID int64,
) error

HandleOwnerScheduleTable schedule tables

func IsHTTPBadRequestError

func IsHTTPBadRequestError(err error) bool

IsHTTPBadRequestError check if a error is a http bad request error

func WriteData

func WriteData(w http.ResponseWriter, data interface{})

WriteData write data to response with http status code 200

func WriteError

func WriteError(w http.ResponseWriter, statusCode int, err error)

WriteError write error message to response

Types

This section is empty.

Directories

Path Synopsis
Package v2 is a generated GoMock package.
Package v2 is a generated GoMock package.

Jump to

Keyboard shortcuts

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