codegen

package
v0.0.1-alpha1 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package codegen 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

View Source
const (
	Access_tokenScopes = "access_token.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 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 BaseResponse

type BaseResponse struct {
	// Message message returned by server side if there is any
	Message *string `json:"message,omitempty"`
}

BaseResponse defines model for BaseResponse.

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 GetReleaseParams

type GetReleaseParams struct {
	// Version version of the release
	Version *Version `form:"version,omitempty" json:"version,omitempty"`
}

GetReleaseParams defines parameters for GetRelease.

type InstallReleaseParams

type InstallReleaseParams struct {
	// Version version of the release
	Version *Version `form:"version,omitempty" json:"version,omitempty"`
}

InstallReleaseParams defines parameters for InstallRelease.

type Module

type Module struct {
	Name  string `json:"name"`
	Short string `json:"short"`
}

Module defines model for Module.

type Package

type Package struct {
	Architecture PackageArchitecture `json:"architecture"`
	Path         string              `json:"path"`
}

Package defines model for Package.

type PackageArchitecture

type PackageArchitecture string

PackageArchitecture defines model for Package.Architecture.

const (
	Amd64 PackageArchitecture = "amd64"
	Arm64 PackageArchitecture = "arm64"
	Arm7  PackageArchitecture = "arm-7"
)

Defines values for PackageArchitecture.

type Release

type Release struct {
	Mirrors      []string  `json:"mirrors"`
	Modules      []Module  `json:"modules"`
	Packages     []Package `json:"packages"`
	ReleaseNotes string    `json:"release_notes" yaml:"release_notes,omitempty"`
	Version      string    `json:"version"`
}

Release defines model for Release.

type ReleaseOK

type ReleaseOK struct {
	Data *Release `json:"data,omitempty"`

	// Message message returned by server side if there is any
	Message *string `json:"message,omitempty"`
}

ReleaseOK defines model for ReleaseOK.

type ResponseInternalServerError

type ResponseInternalServerError = BaseResponse

ResponseInternalServerError defines model for ResponseInternalServerError.

type ResponseNotFound

type ResponseNotFound = BaseResponse

ResponseNotFound defines model for ResponseNotFound.

type ResponseOK

type ResponseOK = BaseResponse

ResponseOK defines model for ResponseOK.

type ServerInterface

type ServerInterface interface {
	// Get the information about the latest release of CasaOS
	// (GET /release)
	GetRelease(ctx echo.Context, params GetReleaseParams) error
	// Install a release of CasaOS
	// (POST /release)
	InstallRelease(ctx echo.Context, params InstallReleaseParams) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) GetRelease

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

GetRelease converts echo context to params.

func (*ServerInterfaceWrapper) InstallRelease

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

InstallRelease converts echo context to params.

type Version

type Version = string

Version defines model for Version.

Jump to

Keyboard shortcuts

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