api

package
v0.0.0-...-daa3d23 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: Apache-2.0 Imports: 11 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.16.2 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.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 Attributes

type Attributes map[string]string

Attributes defines model for Attributes.

type ContainerRegistry

type ContainerRegistry struct {
	Id                 string     `json:"id"`
	RegistryAttributes Attributes `json:"registryAttributes"`
	RegistryType       string     `json:"registryType"`
	RegistryUrl        string     `json:"registryUrl"`
}

ContainerRegistry defines model for ContainerRegistry.

type ContainerRegistryResponse

type ContainerRegistryResponse struct {
	Registry      *ContainerRegistry `json:"registry,omitempty"`
	Status        Status             `json:"status"`
	StatusMessage string             `json:"statusMessage"`
}

ContainerRegistryResponse defines model for ContainerRegistryResponse.

type GinServerOptions

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

GinServerOptions provides options for the Gin server.

type GitProject

type GitProject struct {
	AccessToken string `json:"accessToken"`
	Id          string `json:"id"`
	ProjectUrl  string `json:"projectUrl"`
	Username    string `json:"username"`
}

GitProject defines model for GitProject.

type GitProjectResponse

type GitProjectResponse struct {
	Project       GitProject `json:"project"`
	Status        Status     `json:"status"`
	StatusMessage string     `json:"statusMessage"`
}

GitProjectResponse defines model for GitProjectResponse.

type MiddlewareFunc

type MiddlewareFunc func(c *gin.Context)

type ServerInterface

type ServerInterface interface {
	// List of APIs provided by the service
	// (GET /api-docs)
	GetApiDocs(c *gin.Context)
	// Get container Registry by ID
	// (GET /containerregistry/{id})
	GetContainerRegistryById(c *gin.Context, id string)
	// Get git project details by ID
	// (GET /gitproject/{id})
	GetGitProjectById(c *gin.Context, id string)
}

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) GetContainerRegistryById

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

GetContainerRegistryById operation middleware

func (*ServerInterfaceWrapper) GetGitProjectById

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

GetGitProjectById operation middleware

type Status

type Status string

Status defines model for Status.

const (
	INTERNALERROR   Status = "INTERNAL_ERROR"
	INVALIDARGUMENT Status = "INVALID_ARGUMENT"
	NOTFOUND        Status = "NOT_FOUND"
	OK              Status = "OK"
)

Defines values for Status.

Jump to

Keyboard shortcuts

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