adapters

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

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

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

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

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

type Cpu = models.Cpu

type Devices

type Devices = models.Devices

type Disk

type Disk = models.Disk

type DiskDevice

type DiskDevice = models.DiskDevice

type DiskType

type DiskType = models.DiskType

type GetAllVMsList200Response

type GetAllVMsList200Response = models.GetAllVMsList200Response

type GetApiV1VmsVmIdPowerJSONRequestBody

type GetApiV1VmsVmIdPowerJSONRequestBody = models.VmPowerInfo

type GetHost200Response

type GetHost200Response = models.GetHost200Response

type GetVMByVMId200Response

type GetVMByVMId200Response = models.GetVMByVMId200Response

type GetVMPowerByVMId200Response

type GetVMPowerByVMId200Response = models.GetVMPowerByVMId200Response

type GinServerOptions

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

GinServerOptions provides options for the Gin server.

type Host

type Host = models.Host

type Memory

type Memory = models.Memory

type Metadata

type Metadata = models.Metadata

type MiddlewareFunc

type MiddlewareFunc func(c *gin.Context)

type PatchApiV1VmsVmIdJSONBody

type PatchApiV1VmsVmIdJSONBody = models.PatchApiV1VmsVmIdJSONBody

type PatchApiV1VmsVmIdJSONRequestBody

type PatchApiV1VmsVmIdJSONRequestBody = models.PatchApiV1VmsVmIdJSONRequestBody

type PatchUpdateVMByVMId200Response

type PatchUpdateVMByVMId200Response = models.PatchUpdateVMByVMId200Response

type PostApiV1VmsJSONBody

type PostApiV1VmsJSONBody = models.PostApiV1VmsJSONBody

type PostApiV1VmsJSONRequestBody

type PostApiV1VmsJSONRequestBody = models.PostApiV1VmsJSONRequestBody

type PostApiV1VmsVmIdPowerActionParams

type PostApiV1VmsVmIdPowerActionParams = models.PostApiV1VmsVmIdPowerActionParams

type PostCreateNewVM200Response

type PostCreateNewVM200Response = models.PostCreateNewVM200Response

type ServerInterface

type ServerInterface interface {
	// Get a host
	// (GET /api/v1/host)
	GetApiV1Host(c *gin.Context)
	// Get all VMs list
	// (GET /api/v1/vms)
	GetApiV1Vms(c *gin.Context)
	// Create a new VM
	// (POST /api/v1/vms)
	PostApiV1Vms(c *gin.Context)
	// Get a VM
	// (GET /api/v1/vms/{vmId})
	GetApiV1VmsVmId(c *gin.Context, vmId openapi_types.UUID)
	// Update a VM
	// (PATCH /api/v1/vms/{vmId})
	PatchApiV1VmsVmId(c *gin.Context, vmId openapi_types.UUID)
	// Get Power State
	// (GET /api/v1/vms/{vmId}/power)
	GetApiV1VmsVmIdPower(c *gin.Context, vmId openapi_types.UUID)
	// Change Power Status
	// (POST /api/v1/vms/{vmId}/power)
	PostApiV1VmsVmIdPowerAction(c *gin.Context, vmId openapi_types.UUID, params PostApiV1VmsVmIdPowerActionParams)
}

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

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

GetApiV1Host operation middleware

func (*ServerInterfaceWrapper) GetApiV1Vms

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

GetApiV1Vms operation middleware

func (*ServerInterfaceWrapper) GetApiV1VmsVmId

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

GetApiV1VmsVmId operation middleware

func (*ServerInterfaceWrapper) GetApiV1VmsVmIdPower

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

GetApiV1VmsVmIdPower operation middleware

func (*ServerInterfaceWrapper) PatchApiV1VmsVmId

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

PatchApiV1VmsVmId operation middleware

func (*ServerInterfaceWrapper) PostApiV1Vms

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

PostApiV1Vms operation middleware

func (*ServerInterfaceWrapper) PostApiV1VmsVmIdPowerAction

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

PostApiV1VmsVmIdPowerAction operation middleware

type StoragePool

type StoragePool = models.StoragePool

type StoragePoolStatus

type StoragePoolStatus = models.StoragePoolStatus

type Vm

type Vm = models.Vm

type VmPowerInfo

type VmPowerInfo = models.VmPowerInfo

type VmPowerInfoState

type VmPowerInfoState = models.VmPowerInfoState

type VmStatus

type VmStatus = models.VmStatus

Jump to

Keyboard shortcuts

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