api

package
v1.0.1-0...-bdf2eb1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

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

Code generated by github.com/deepmap/oapi-codegen version v1.12.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 *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 GinServerOptions

type GinServerOptions struct {
	BaseURL      string
	Middlewares  []MiddlewareFunc
	ErrorHandler func(*gin.Context, error, int)
}

GinServerOptions provides options for the Gin server.

type MiddlewareFunc

type MiddlewareFunc func(c *gin.Context)

type PostAzureJSONBody

type PostAzureJSONBody = map[string]interface{}

PostAzureJSONBody defines parameters for PostAzure.

type PostAzureJSONRequestBody

type PostAzureJSONRequestBody = PostAzureJSONBody

PostAzureJSONRequestBody defines body for PostAzure for application/json ContentType.

type PostBitbucketJSONBody

type PostBitbucketJSONBody = map[string]interface{}

PostBitbucketJSONBody defines parameters for PostBitbucket.

type PostBitbucketJSONRequestBody

type PostBitbucketJSONRequestBody = PostBitbucketJSONBody

PostBitbucketJSONRequestBody defines body for PostBitbucket for application/json ContentType.

type PostGiteaJSONBody

type PostGiteaJSONBody = map[string]interface{}

PostGiteaJSONBody defines parameters for PostGitea.

type PostGiteaJSONRequestBody

type PostGiteaJSONRequestBody = PostGiteaJSONBody

PostGiteaJSONRequestBody defines body for PostGitea for application/json ContentType.

type PostGithubJSONBody

type PostGithubJSONBody = map[string]interface{}

PostGithubJSONBody defines parameters for PostGithub.

type PostGithubJSONRequestBody

type PostGithubJSONRequestBody = PostGithubJSONBody

PostGithubJSONRequestBody defines body for PostGithub for application/json ContentType.

type PostGitlabJSONBody

type PostGitlabJSONBody = map[string]interface{}

PostGitlabJSONBody defines parameters for PostGitlab.

type PostGitlabJSONRequestBody

type PostGitlabJSONRequestBody = PostGitlabJSONBody

PostGitlabJSONRequestBody defines body for PostGitlab for application/json ContentType.

type ServerInterface

type ServerInterface interface {
	// List of APIs provided by the service
	// (GET /api-docs)
	GetApiDocs(c *gin.Context)
	// Handle Azure webhooks post requests
	// (POST /azure)
	PostAzure(c *gin.Context)
	// Handle Bitbucket webhooks post requests
	// (POST /bitbucket)
	PostBitbucket(c *gin.Context)
	// Handle Gitea webhooks post requests
	// (POST /gitea)
	PostGitea(c *gin.Context)
	// Handle Github webhooks post requests
	// (POST /github)
	PostGithub(c *gin.Context)
	// Handle Gitlab webhooks post requests
	// (POST /gitlab)
	PostGitlab(c *gin.Context)
	// Kubernetes readiness and liveness probe endpoint
	// (GET /liveness)
	GetLiveness(c *gin.Context)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandler       func(*gin.Context, error, int)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) GetApiDocs

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

GetApiDocs operation middleware

func (*ServerInterfaceWrapper) GetLiveness

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

GetLiveness operation middleware

func (*ServerInterfaceWrapper) PostAzure

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

PostAzure operation middleware

func (*ServerInterfaceWrapper) PostBitbucket

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

PostBitbucket operation middleware

func (*ServerInterfaceWrapper) PostGitea

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

PostGitea operation middleware

func (*ServerInterfaceWrapper) PostGithub

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

PostGithub operation middleware

func (*ServerInterfaceWrapper) PostGitlab

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

PostGitlab operation middleware

Jump to

Keyboard shortcuts

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