api

package
v0.0.0-...-a460b6c Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 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/v2 version v2.1.0 DO NOT EDIT.

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

Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.

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

Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.

Index

Constants

View Source
const (
	BearerAuthScopes = "BearerAuth.Scopes"
)

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.IRouter, si ServerInterface)

RegisterHandlers creates http.Handler with routing matching OpenAPI spec.

func RegisterHandlersWithOptions

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

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 PostWebhookJSONRequestBody

type PostWebhookJSONRequestBody = WebhookPayload

PostWebhookJSONRequestBody defines body for PostWebhook for application/json ContentType.

type ServerInterface

type ServerInterface interface {
	// Webhook for branch merge event
	// (POST /webhook)
	PostWebhook(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) PostWebhook

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

PostWebhook operation middleware

type WebhookPayload

type WebhookPayload struct {
	After   *string `json:"after,omitempty"`
	Before  *string `json:"before,omitempty"`
	Commits *[]struct {
		Author *struct {
			Email *string `json:"email,omitempty"`
			Name  *string `json:"name,omitempty"`
		} `json:"author,omitempty"`
		Id        *string `json:"id,omitempty"`
		Message   *string `json:"message,omitempty"`
		Timestamp *string `json:"timestamp,omitempty"`
		Url       *string `json:"url,omitempty"`
	} `json:"commits,omitempty"`
	Pusher *struct {
		Email *string `json:"email,omitempty"`
		Name  *string `json:"name,omitempty"`
	} `json:"pusher,omitempty"`
	Ref        *string `json:"ref,omitempty"`
	Repository *struct {
		FullName *string `json:"full_name,omitempty"`
		HtmlUrl  *string `json:"html_url,omitempty"`
	} `json:"repository,omitempty"`
}

WebhookPayload defines model for WebhookPayload.

Jump to

Keyboard shortcuts

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