openapi

package
v0.0.0-...-4681efc Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: Unlicense Imports: 13 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.13.4 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 EchoRouter, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

func RegisterHandlersWithBaseURL

func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)

Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.

Types

type BranchPreview

type BranchPreview struct {
	Name string `json:"name"`
}

BranchPreview defines model for BranchPreview.

type CommitPreview

type CommitPreview struct {
	Message string `json:"message"`
	Sha1    string `json:"sha1"`
}

CommitPreview defines model for CommitPreview.

type EchoRouter

type EchoRouter interface {
	CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}

This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration

type Error

type Error struct {
	Message string `json:"message"`
}

Error defines model for Error.

type ErrorJSONResponse

type ErrorJSONResponse Error

type FileDiff

type FileDiff struct {
	Dst      State  `json:"dst"`
	IsBinary bool   `json:"isBinary"`
	Lines    Range  `json:"lines"`
	Src      State  `json:"src"`
	Status   Status `json:"status"`
}

FileDiff defines model for FileDiff.

type GetRepoBranches200JSONResponse

type GetRepoBranches200JSONResponse []BranchPreview

func (GetRepoBranches200JSONResponse) VisitGetRepoBranchesResponse

func (response GetRepoBranches200JSONResponse) VisitGetRepoBranchesResponse(w http.ResponseWriter) error

type GetRepoBranches400JSONResponse

type GetRepoBranches400JSONResponse struct{ ErrorJSONResponse }

func (GetRepoBranches400JSONResponse) VisitGetRepoBranchesResponse

func (response GetRepoBranches400JSONResponse) VisitGetRepoBranchesResponse(w http.ResponseWriter) error

type GetRepoBranchesBranchCommits200JSONResponse

type GetRepoBranchesBranchCommits200JSONResponse []CommitPreview

func (GetRepoBranchesBranchCommits200JSONResponse) VisitGetRepoBranchesBranchCommitsResponse

func (response GetRepoBranchesBranchCommits200JSONResponse) VisitGetRepoBranchesBranchCommitsResponse(w http.ResponseWriter) error

type GetRepoBranchesBranchCommitsRequestObject

type GetRepoBranchesBranchCommitsRequestObject struct {
	Branch string `json:"branch"`
}

type GetRepoBranchesBranchCommitsResponseObject

type GetRepoBranchesBranchCommitsResponseObject interface {
	VisitGetRepoBranchesBranchCommitsResponse(w http.ResponseWriter) error
}

type GetRepoBranchesRequestObject

type GetRepoBranchesRequestObject struct {
}

type GetRepoBranchesResponseObject

type GetRepoBranchesResponseObject interface {
	VisitGetRepoBranchesResponse(w http.ResponseWriter) error
}

type GetRepoDiffMap200JSONResponse

type GetRepoDiffMap200JSONResponse struct {
	Files      []FileDiff `json:"files"`
	LinesTotal int        `json:"linesTotal"`
}

func (GetRepoDiffMap200JSONResponse) VisitGetRepoDiffMapResponse

func (response GetRepoDiffMap200JSONResponse) VisitGetRepoDiffMapResponse(w http.ResponseWriter) error

type GetRepoDiffMap400JSONResponse

type GetRepoDiffMap400JSONResponse struct{ ErrorJSONResponse }

func (GetRepoDiffMap400JSONResponse) VisitGetRepoDiffMapResponse

func (response GetRepoDiffMap400JSONResponse) VisitGetRepoDiffMapResponse(w http.ResponseWriter) error

type GetRepoDiffMapParams

type GetRepoDiffMapParams struct {
	// A First commit
	A string `form:"a" json:"a"`

	// B Second commit
	B string `form:"b" json:"b"`
}

GetRepoDiffMapParams defines parameters for GetRepoDiffMap.

type GetRepoDiffMapRequestObject

type GetRepoDiffMapRequestObject struct {
	Params GetRepoDiffMapParams
}

type GetRepoDiffMapResponseObject

type GetRepoDiffMapResponseObject interface {
	VisitGetRepoDiffMapResponse(w http.ResponseWriter) error
}

type GetRepoDiffPart200JSONResponse

type GetRepoDiffPart200JSONResponse []LineDiff

func (GetRepoDiffPart200JSONResponse) VisitGetRepoDiffPartResponse

func (response GetRepoDiffPart200JSONResponse) VisitGetRepoDiffPartResponse(w http.ResponseWriter) error

type GetRepoDiffPart400JSONResponse

type GetRepoDiffPart400JSONResponse struct{ ErrorJSONResponse }

func (GetRepoDiffPart400JSONResponse) VisitGetRepoDiffPartResponse

func (response GetRepoDiffPart400JSONResponse) VisitGetRepoDiffPartResponse(w http.ResponseWriter) error

type GetRepoDiffPartParams

type GetRepoDiffPartParams struct {
	// A First commit
	A string `form:"a" json:"a"`

	// B Second commit
	B string `form:"b" json:"b"`

	// Start Start line of the diff
	Start int `form:"start" json:"start"`

	// End End line for the diff
	End int `form:"end" json:"end"`
}

GetRepoDiffPartParams defines parameters for GetRepoDiffPart.

type GetRepoDiffPartRequestObject

type GetRepoDiffPartRequestObject struct {
	Params GetRepoDiffPartParams
}

type GetRepoDiffPartResponseObject

type GetRepoDiffPartResponseObject interface {
	VisitGetRepoDiffPartResponse(w http.ResponseWriter) error
}

type GetRepoFile200JSONResponse

type GetRepoFile200JSONResponse []string

func (GetRepoFile200JSONResponse) VisitGetRepoFileResponse

func (response GetRepoFile200JSONResponse) VisitGetRepoFileResponse(w http.ResponseWriter) error

type GetRepoFile400JSONResponse

type GetRepoFile400JSONResponse struct{ ErrorJSONResponse }

func (GetRepoFile400JSONResponse) VisitGetRepoFileResponse

func (response GetRepoFile400JSONResponse) VisitGetRepoFileResponse(w http.ResponseWriter) error

type GetRepoFileParams

type GetRepoFileParams struct {
	// Revision Revision of the file
	Revision *string `form:"revision,omitempty" json:"revision,omitempty"`

	// Path Path to the file
	Path string `form:"path" json:"path"`

	// Start Start line number. Defaults to 0 if omitted. Using a value that is out of bounds will be rounded to the closest bound.
	Start *int `form:"start,omitempty" json:"start,omitempty"`

	// End End line number. Defaults to the last line of the file if omitted. Using a value that is out of bounds will be rounded to the closest bound.
	End *int `form:"end,omitempty" json:"end,omitempty"`
}

GetRepoFileParams defines parameters for GetRepoFile.

type GetRepoFileRequestObject

type GetRepoFileRequestObject struct {
	Params GetRepoFileParams
}

type GetRepoFileResponseObject

type GetRepoFileResponseObject interface {
	VisitGetRepoFileResponse(w http.ResponseWriter) error
}

type LineDiff

type LineDiff struct {
	Dst       LineState         `json:"dst"`
	Operation LineDiffOperation `json:"operation"`
	Src       LineState         `json:"src"`
}

LineDiff defines model for LineDiff.

type LineDiffOperation

type LineDiffOperation string

LineDiffOperation defines model for LineDiff.Operation.

const (
	LineDiffOperationA LineDiffOperation = "A"
	LineDiffOperationD LineDiffOperation = "D"
	LineDiffOperationM LineDiffOperation = "M"
)

Defines values for LineDiffOperation.

type LineState

type LineState struct {
	Content string `json:"content"`
	Number  int64  `json:"number"`
}

LineState defines model for LineState.

type Range

type Range struct {
	End   int `json:"end"`
	Start int `json:"start"`
}

Range defines model for Range.

type ServerInterface

type ServerInterface interface {
	// Get repo branches
	// (GET /repo/branches)
	GetRepoBranches(ctx echo.Context) error
	// Get branch commits
	// (GET /repo/branches/{branch}/commits)
	GetRepoBranchesBranchCommits(ctx echo.Context, branch string) error
	// Calculate the difference between 'a' and 'b' for mapping.
	// (GET /repo/diff/map)
	GetRepoDiffMap(ctx echo.Context, params GetRepoDiffMapParams) error
	// Get information about partial diff between a and b for given startline and endline
	// (GET /repo/diff/part)
	GetRepoDiffPart(ctx echo.Context, params GetRepoDiffPartParams) error
	// Get file contents
	// (GET /repo/file)
	GetRepoFile(ctx echo.Context, params GetRepoFileParams) error
}

ServerInterface represents all server handlers.

func NewStrictHandler

func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) GetRepoBranches

func (w *ServerInterfaceWrapper) GetRepoBranches(ctx echo.Context) error

GetRepoBranches converts echo context to params.

func (*ServerInterfaceWrapper) GetRepoBranchesBranchCommits

func (w *ServerInterfaceWrapper) GetRepoBranchesBranchCommits(ctx echo.Context) error

GetRepoBranchesBranchCommits converts echo context to params.

func (*ServerInterfaceWrapper) GetRepoDiffMap

func (w *ServerInterfaceWrapper) GetRepoDiffMap(ctx echo.Context) error

GetRepoDiffMap converts echo context to params.

func (*ServerInterfaceWrapper) GetRepoDiffPart

func (w *ServerInterfaceWrapper) GetRepoDiffPart(ctx echo.Context) error

GetRepoDiffPart converts echo context to params.

func (*ServerInterfaceWrapper) GetRepoFile

func (w *ServerInterfaceWrapper) GetRepoFile(ctx echo.Context) error

GetRepoFile converts echo context to params.

type State

type State struct {
	Path string `json:"path"`
}

State defines model for State.

type Status

type Status struct {
	Score *int       `json:"score,omitempty"`
	Type  StatusType `json:"type"`
}

Status defines model for Status.

type StatusType

type StatusType string

StatusType defines model for Status.Type.

const (
	StatusTypeA StatusType = "A"
	StatusTypeC StatusType = "C"
	StatusTypeD StatusType = "D"
	StatusTypeM StatusType = "M"
	StatusTypeR StatusType = "R"
	StatusTypeT StatusType = "T"
	StatusTypeU StatusType = "U"
	StatusTypeX StatusType = "X"
)

Defines values for StatusType.

type StrictHandlerFunc

type StrictHandlerFunc = runtime.StrictEchoHandlerFunc

type StrictMiddlewareFunc

type StrictMiddlewareFunc = runtime.StrictEchoMiddlewareFunc

type StrictServerInterface

type StrictServerInterface interface {
	// Get repo branches
	// (GET /repo/branches)
	GetRepoBranches(ctx context.Context, request GetRepoBranchesRequestObject) (GetRepoBranchesResponseObject, error)
	// Get branch commits
	// (GET /repo/branches/{branch}/commits)
	GetRepoBranchesBranchCommits(ctx context.Context, request GetRepoBranchesBranchCommitsRequestObject) (GetRepoBranchesBranchCommitsResponseObject, error)
	// Calculate the difference between 'a' and 'b' for mapping.
	// (GET /repo/diff/map)
	GetRepoDiffMap(ctx context.Context, request GetRepoDiffMapRequestObject) (GetRepoDiffMapResponseObject, error)
	// Get information about partial diff between a and b for given startline and endline
	// (GET /repo/diff/part)
	GetRepoDiffPart(ctx context.Context, request GetRepoDiffPartRequestObject) (GetRepoDiffPartResponseObject, error)
	// Get file contents
	// (GET /repo/file)
	GetRepoFile(ctx context.Context, request GetRepoFileRequestObject) (GetRepoFileResponseObject, error)
}

StrictServerInterface represents all server handlers.

Jump to

Keyboard shortcuts

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