openapi

package
v0.0.0-...-fa598ba Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package openapi provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.9.0 DO NOT EDIT.

Package openapi provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.9.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

func RegisterHandlers

func RegisterHandlers(router *gin.Engine, si ServerInterface) *gin.Engine

RegisterHandlers creates http.Handler with routing matching OpenAPI spec.

func RegisterHandlersWithOptions

func RegisterHandlersWithOptions(router *gin.Engine, si ServerInterface, options GinServerOptions) *gin.Engine

RegisterHandlersWithOptions creates http.Handler with additional options

Types

type DMAPIDeleteBinlogOperatorParams

type DMAPIDeleteBinlogOperatorParams struct {
	BinlogPos *string `json:"binlog_pos,omitempty"`
}

DMAPIDeleteBinlogOperatorParams defines parameters for DMAPIDeleteBinlogOperator.

type DMAPIGetBinlogOperatorParams

type DMAPIGetBinlogOperatorParams struct {
	BinlogPos *string `json:"binlog_pos,omitempty"`
}

DMAPIGetBinlogOperatorParams defines parameters for DMAPIGetBinlogOperator.

type DMAPIGetJobStatusParams

type DMAPIGetJobStatusParams struct {
	// globally unique data source name
	Tasks *[]string `json:"tasks,omitempty"`
}

DMAPIGetJobStatusParams defines parameters for DMAPIGetJobStatus.

type DMAPIGetSchemaParams

type DMAPIGetSchemaParams struct {
	// database name
	Database *string `json:"database,omitempty"`

	// table name
	Table *string `json:"table,omitempty"`

	// target table
	Target *bool `json:"target,omitempty"`
}

DMAPIGetSchemaParams defines parameters for DMAPIGetSchema.

type DMAPIOperateJobJSONBody

type DMAPIOperateJobJSONBody OperateJobRequest

DMAPIOperateJobJSONBody defines parameters for DMAPIOperateJob.

type DMAPIOperateJobJSONRequestBody

type DMAPIOperateJobJSONRequestBody DMAPIOperateJobJSONBody

DMAPIOperateJobJSONRequestBody defines body for DMAPIOperateJob for application/json ContentType.

type DMAPISetBinlogOperatorJSONBody

type DMAPISetBinlogOperatorJSONBody SetBinlogOperatorRequest

DMAPISetBinlogOperatorJSONBody defines parameters for DMAPISetBinlogOperator.

type DMAPISetBinlogOperatorJSONRequestBody

type DMAPISetBinlogOperatorJSONRequestBody DMAPISetBinlogOperatorJSONBody

DMAPISetBinlogOperatorJSONRequestBody defines body for DMAPISetBinlogOperator for application/json ContentType.

type DMAPISetSchemaJSONBody

type DMAPISetSchemaJSONBody SetBinlogSchemaRequest

DMAPISetSchemaJSONBody defines parameters for DMAPISetSchema.

type DMAPISetSchemaJSONRequestBody

type DMAPISetSchemaJSONRequestBody DMAPISetSchemaJSONBody

DMAPISetSchemaJSONRequestBody defines body for DMAPISetSchema for application/json ContentType.

type DMAPIUpdateJobConfigJSONBody

type DMAPIUpdateJobConfigJSONBody UpdateJobConfigRequest

DMAPIUpdateJobConfigJSONBody defines parameters for DMAPIUpdateJobConfig.

type DMAPIUpdateJobConfigJSONRequestBody

type DMAPIUpdateJobConfigJSONRequestBody DMAPIUpdateJobConfigJSONBody

DMAPIUpdateJobConfigJSONRequestBody defines body for DMAPIUpdateJobConfig for application/json ContentType.

type ErrorWithMessage

type ErrorWithMessage struct {
	// error code
	Code    int       `json:"code"`
	Details *[]string `json:"details,omitempty"`

	// error message
	Message string `json:"message"`
}

operation error

type GinServerOptions

type GinServerOptions struct {
	BaseURL     string
	Middlewares []MiddlewareFunc
}

GinServerOptions provides options for the Gin server.

type MiddlewareFunc

type MiddlewareFunc func(c *gin.Context)

type OperateJobRequest

type OperateJobRequest struct {
	Op    OperateJobRequestOp `json:"op"`
	Tasks *[]string           `json:"tasks,omitempty"`
}

OperateJobRequest defines model for OperateJobRequest.

type OperateJobRequestOp

type OperateJobRequestOp string

OperateJobRequestOp defines model for OperateJobRequest.Op.

const (
	OperateJobRequestOpPause OperateJobRequestOp = "pause"

	OperateJobRequestOpResume OperateJobRequestOp = "resume"
)

Defines values for OperateJobRequestOp.

type ServerInterface

type ServerInterface interface {
	// delete binlog operator
	// (DELETE /binlog/tasks/{task-name})
	DMAPIDeleteBinlogOperator(c *gin.Context, taskName string, params DMAPIDeleteBinlogOperatorParams)
	// get binlog operator
	// (GET /binlog/tasks/{task-name})
	DMAPIGetBinlogOperator(c *gin.Context, taskName string, params DMAPIGetBinlogOperatorParams)
	// set binlog operator
	// (POST /binlog/tasks/{task-name})
	DMAPISetBinlogOperator(c *gin.Context, taskName string)
	// get job config
	// (GET /config)
	DMAPIGetJobConfig(c *gin.Context)
	// update job config
	// (PUT /config)
	DMAPIUpdateJobConfig(c *gin.Context)
	// get schema
	// (GET /schema/tasks/{task-name})
	DMAPIGetSchema(c *gin.Context, taskName string, params DMAPIGetSchemaParams)
	// set schema
	// (PUT /schema/tasks/{task-name})
	DMAPISetSchema(c *gin.Context, taskName string)
	// get the current status of the job
	// (GET /status)
	DMAPIGetJobStatus(c *gin.Context, params DMAPIGetJobStatusParams)
	// operate the stage of the job
	// (PUT /status)
	DMAPIOperateJob(c *gin.Context)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) DMAPIDeleteBinlogOperator

func (siw *ServerInterfaceWrapper) DMAPIDeleteBinlogOperator(c *gin.Context)

DMAPIDeleteBinlogOperator operation middleware

func (*ServerInterfaceWrapper) DMAPIGetBinlogOperator

func (siw *ServerInterfaceWrapper) DMAPIGetBinlogOperator(c *gin.Context)

DMAPIGetBinlogOperator operation middleware

func (*ServerInterfaceWrapper) DMAPIGetJobConfig

func (siw *ServerInterfaceWrapper) DMAPIGetJobConfig(c *gin.Context)

DMAPIGetJobConfig operation middleware

func (*ServerInterfaceWrapper) DMAPIGetJobStatus

func (siw *ServerInterfaceWrapper) DMAPIGetJobStatus(c *gin.Context)

DMAPIGetJobStatus operation middleware

func (*ServerInterfaceWrapper) DMAPIGetSchema

func (siw *ServerInterfaceWrapper) DMAPIGetSchema(c *gin.Context)

DMAPIGetSchema operation middleware

func (*ServerInterfaceWrapper) DMAPIOperateJob

func (siw *ServerInterfaceWrapper) DMAPIOperateJob(c *gin.Context)

DMAPIOperateJob operation middleware

func (*ServerInterfaceWrapper) DMAPISetBinlogOperator

func (siw *ServerInterfaceWrapper) DMAPISetBinlogOperator(c *gin.Context)

DMAPISetBinlogOperator operation middleware

func (*ServerInterfaceWrapper) DMAPISetSchema

func (siw *ServerInterfaceWrapper) DMAPISetSchema(c *gin.Context)

DMAPISetSchema operation middleware

func (*ServerInterfaceWrapper) DMAPIUpdateJobConfig

func (siw *ServerInterfaceWrapper) DMAPIUpdateJobConfig(c *gin.Context)

DMAPIUpdateJobConfig operation middleware

type SetBinlogOperatorRequest

type SetBinlogOperatorRequest struct {
	BinlogPos *string                    `json:"binlog_pos,omitempty"`
	Op        SetBinlogOperatorRequestOp `json:"op"`
	Sqls      *[]string                  `json:"sqls,omitempty"`
}

SetBinlogOperatorRequest defines model for SetBinlogOperatorRequest.

type SetBinlogOperatorRequestOp

type SetBinlogOperatorRequestOp string

SetBinlogOperatorRequestOp defines model for SetBinlogOperatorRequest.Op.

const (
	SetBinlogOperatorRequestOpInject SetBinlogOperatorRequestOp = "inject"

	SetBinlogOperatorRequestOpReplace SetBinlogOperatorRequestOp = "replace"

	SetBinlogOperatorRequestOpSkip SetBinlogOperatorRequestOp = "skip"
)

Defines values for SetBinlogOperatorRequestOp.

type SetBinlogSchemaRequest

type SetBinlogSchemaRequest struct {
	Database   string `json:"database"`
	FromSource *bool  `json:"from_source,omitempty"`
	FromTarget *bool  `json:"from_target,omitempty"`
	Sql        string `json:"sql"`
	Table      string `json:"table"`
}

SetBinlogSchemaRequest defines model for SetBinlogSchemaRequest.

type UpdateJobConfigRequest

type UpdateJobConfigRequest struct {
	Config string `json:"config"`
}

UpdateJobConfigRequest defines model for UpdateJobConfigRequest.

Jump to

Keyboard shortcuts

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