gen

package
v0.0.0-...-36c55c0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package gen contains generated code for the Power API.

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

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

Index

Constants

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

Variables

This section is empty.

Functions

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 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 ErrorResponse

type ErrorResponse = externalRef0.ErrorResponse

ErrorResponse defines model for ErrorResponse.

type Hostname

type Hostname = string

Hostname defines model for Hostname.

type PostNodePowerReboot200JSONResponse

type PostNodePowerReboot200JSONResponse PowerRebootResponse

func (PostNodePowerReboot200JSONResponse) VisitPostNodePowerRebootResponse

func (response PostNodePowerReboot200JSONResponse) VisitPostNodePowerRebootResponse(w http.ResponseWriter) error

type PostNodePowerReboot400JSONResponse

type PostNodePowerReboot400JSONResponse externalRef0.ErrorResponse

func (PostNodePowerReboot400JSONResponse) VisitPostNodePowerRebootResponse

func (response PostNodePowerReboot400JSONResponse) VisitPostNodePowerRebootResponse(w http.ResponseWriter) error

type PostNodePowerReboot401JSONResponse

type PostNodePowerReboot401JSONResponse externalRef0.ErrorResponse

func (PostNodePowerReboot401JSONResponse) VisitPostNodePowerRebootResponse

func (response PostNodePowerReboot401JSONResponse) VisitPostNodePowerRebootResponse(w http.ResponseWriter) error

type PostNodePowerReboot403JSONResponse

type PostNodePowerReboot403JSONResponse externalRef0.ErrorResponse

func (PostNodePowerReboot403JSONResponse) VisitPostNodePowerRebootResponse

func (response PostNodePowerReboot403JSONResponse) VisitPostNodePowerRebootResponse(w http.ResponseWriter) error

type PostNodePowerReboot500JSONResponse

type PostNodePowerReboot500JSONResponse externalRef0.ErrorResponse

func (PostNodePowerReboot500JSONResponse) VisitPostNodePowerRebootResponse

func (response PostNodePowerReboot500JSONResponse) VisitPostNodePowerRebootResponse(w http.ResponseWriter) error

type PostNodePowerRebootJSONRequestBody

type PostNodePowerRebootJSONRequestBody = PowerRequest

PostNodePowerRebootJSONRequestBody defines body for PostNodePowerReboot for application/json ContentType.

type PostNodePowerRebootRequestObject

type PostNodePowerRebootRequestObject struct {
	Hostname Hostname `json:"hostname"`
	Body     *PostNodePowerRebootJSONRequestBody
}

type PostNodePowerRebootResponseObject

type PostNodePowerRebootResponseObject interface {
	VisitPostNodePowerRebootResponse(w http.ResponseWriter) error
}

type PostNodePowerShutdown200JSONResponse

type PostNodePowerShutdown200JSONResponse PowerShutdownResponse

func (PostNodePowerShutdown200JSONResponse) VisitPostNodePowerShutdownResponse

func (response PostNodePowerShutdown200JSONResponse) VisitPostNodePowerShutdownResponse(w http.ResponseWriter) error

type PostNodePowerShutdown400JSONResponse

type PostNodePowerShutdown400JSONResponse externalRef0.ErrorResponse

func (PostNodePowerShutdown400JSONResponse) VisitPostNodePowerShutdownResponse

func (response PostNodePowerShutdown400JSONResponse) VisitPostNodePowerShutdownResponse(w http.ResponseWriter) error

type PostNodePowerShutdown401JSONResponse

type PostNodePowerShutdown401JSONResponse externalRef0.ErrorResponse

func (PostNodePowerShutdown401JSONResponse) VisitPostNodePowerShutdownResponse

func (response PostNodePowerShutdown401JSONResponse) VisitPostNodePowerShutdownResponse(w http.ResponseWriter) error

type PostNodePowerShutdown403JSONResponse

type PostNodePowerShutdown403JSONResponse externalRef0.ErrorResponse

func (PostNodePowerShutdown403JSONResponse) VisitPostNodePowerShutdownResponse

func (response PostNodePowerShutdown403JSONResponse) VisitPostNodePowerShutdownResponse(w http.ResponseWriter) error

type PostNodePowerShutdown500JSONResponse

type PostNodePowerShutdown500JSONResponse externalRef0.ErrorResponse

func (PostNodePowerShutdown500JSONResponse) VisitPostNodePowerShutdownResponse

func (response PostNodePowerShutdown500JSONResponse) VisitPostNodePowerShutdownResponse(w http.ResponseWriter) error

type PostNodePowerShutdownJSONRequestBody

type PostNodePowerShutdownJSONRequestBody = PowerRequest

PostNodePowerShutdownJSONRequestBody defines body for PostNodePowerShutdown for application/json ContentType.

type PostNodePowerShutdownRequestObject

type PostNodePowerShutdownRequestObject struct {
	Hostname Hostname `json:"hostname"`
	Body     *PostNodePowerShutdownJSONRequestBody
}

type PostNodePowerShutdownResponseObject

type PostNodePowerShutdownResponseObject interface {
	VisitPostNodePowerShutdownResponse(w http.ResponseWriter) error
}

type PowerRebootResponse

type PowerRebootResponse struct {
	// JobId The job ID used to process this request.
	JobId   *openapi_types.UUID `json:"job_id,omitempty"`
	Results []PowerResult       `json:"results"`
}

PowerRebootResponse defines model for PowerRebootResponse.

type PowerRequest

type PowerRequest struct {
	// Delay Delay in seconds before the operation is executed.
	Delay *int `json:"delay,omitempty" validate:"omitempty,min=0"`

	// Message Optional message to broadcast before the operation.
	Message *string `json:"message,omitempty" validate:"omitempty"`
}

PowerRequest defines model for PowerRequest.

type PowerResult

type PowerResult struct {
	// Action The power action performed (reboot, shutdown).
	Action *string `json:"action,omitempty"`

	// Changed Whether the operation modified system state.
	Changed *bool `json:"changed,omitempty"`

	// Delay The delay in seconds before the operation executes.
	Delay *int `json:"delay,omitempty"`

	// Error Error message if the agent failed.
	Error *string `json:"error,omitempty"`

	// Hostname Hostname of the agent that processed this operation.
	Hostname string `json:"hostname"`

	// Status The status of the operation for this host.
	Status PowerResultStatus `json:"status"`
}

PowerResult Result of a power operation for one host.

type PowerResultStatus

type PowerResultStatus string

PowerResultStatus The status of the operation for this host.

const (
	Failed  PowerResultStatus = "failed"
	Ok      PowerResultStatus = "ok"
	Skipped PowerResultStatus = "skipped"
)

Defines values for PowerResultStatus.

type PowerShutdownResponse

type PowerShutdownResponse struct {
	// JobId The job ID used to process this request.
	JobId   *openapi_types.UUID `json:"job_id,omitempty"`
	Results []PowerResult       `json:"results"`
}

PowerShutdownResponse defines model for PowerShutdownResponse.

type ServerInterface

type ServerInterface interface {
	// Reboot node
	// (POST /api/node/{hostname}/power/reboot)
	PostNodePowerReboot(ctx echo.Context, hostname Hostname) error
	// Shutdown node
	// (POST /api/node/{hostname}/power/shutdown)
	PostNodePowerShutdown(ctx echo.Context, hostname Hostname) error
}

ServerInterface represents all server handlers.

func NewStrictHandler

func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) PostNodePowerReboot

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

PostNodePowerReboot converts echo context to params.

func (*ServerInterfaceWrapper) PostNodePowerShutdown

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

PostNodePowerShutdown converts echo context to params.

type StrictHandlerFunc

type StrictHandlerFunc = strictecho.StrictEchoHandlerFunc

type StrictMiddlewareFunc

type StrictMiddlewareFunc = strictecho.StrictEchoMiddlewareFunc

type StrictServerInterface

type StrictServerInterface interface {
	// Reboot node
	// (POST /api/node/{hostname}/power/reboot)
	PostNodePowerReboot(ctx context.Context, request PostNodePowerRebootRequestObject) (PostNodePowerRebootResponseObject, error)
	// Shutdown node
	// (POST /api/node/{hostname}/power/shutdown)
	PostNodePowerShutdown(ctx context.Context, request PostNodePowerShutdownRequestObject) (PostNodePowerShutdownResponseObject, error)
}

StrictServerInterface represents all server handlers.

Jump to

Keyboard shortcuts

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