gen

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package gen contains generated code for the hostname API.

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

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

Index

Constants

View Source
const (
	BearerAuthScopes bearerAuthContextKey = "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)

RegisterHandlersWithBaseURL registers handlers and prepends BaseURL to the paths so the API can be served under a prefix.

func RegisterHandlersWithOptions

func RegisterHandlersWithOptions(router EchoRouter, si ServerInterface, options RegisterHandlersOptions)

RegisterHandlersWithOptions registers handlers using the supplied options, including any per-operation middleware.

Types

type EchoRouter

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 GetNodeHostname200JSONResponse

type GetNodeHostname200JSONResponse HostnameCollectionResponse

func (GetNodeHostname200JSONResponse) VisitGetNodeHostnameResponse

func (response GetNodeHostname200JSONResponse) VisitGetNodeHostnameResponse(w http.ResponseWriter) error

type GetNodeHostname400JSONResponse

type GetNodeHostname400JSONResponse externalRef0.ErrorResponse

func (GetNodeHostname400JSONResponse) VisitGetNodeHostnameResponse

func (response GetNodeHostname400JSONResponse) VisitGetNodeHostnameResponse(w http.ResponseWriter) error

type GetNodeHostname401JSONResponse

type GetNodeHostname401JSONResponse externalRef0.ErrorResponse

func (GetNodeHostname401JSONResponse) VisitGetNodeHostnameResponse

func (response GetNodeHostname401JSONResponse) VisitGetNodeHostnameResponse(w http.ResponseWriter) error

type GetNodeHostname403JSONResponse

type GetNodeHostname403JSONResponse externalRef0.ErrorResponse

func (GetNodeHostname403JSONResponse) VisitGetNodeHostnameResponse

func (response GetNodeHostname403JSONResponse) VisitGetNodeHostnameResponse(w http.ResponseWriter) error

type GetNodeHostname500JSONResponse

type GetNodeHostname500JSONResponse externalRef0.ErrorResponse

func (GetNodeHostname500JSONResponse) VisitGetNodeHostnameResponse

func (response GetNodeHostname500JSONResponse) VisitGetNodeHostnameResponse(w http.ResponseWriter) error

type GetNodeHostnameRequestObject

type GetNodeHostnameRequestObject struct {
	Hostname Hostname `json:"hostname" validate:"required,min=1,valid_target"`
}

type GetNodeHostnameResponseObject

type GetNodeHostnameResponseObject interface {
	VisitGetNodeHostnameResponse(w http.ResponseWriter) error
}

type Hostname

type Hostname = string

Hostname defines model for Hostname.

type HostnameCollectionResponse

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

HostnameCollectionResponse defines model for HostnameCollectionResponse.

type HostnameResponse

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

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

	// Hostname The system's hostname.
	Hostname string `json:"hostname"`

	// Labels Key-value labels configured on the agent.
	Labels *map[string]string `json:"labels,omitempty"`

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

HostnameResponse The hostname of the system.

type HostnameResponseStatus

type HostnameResponseStatus string

HostnameResponseStatus The status of the operation for this host.

const (
	HostnameResponseStatusFailed  HostnameResponseStatus = "failed"
	HostnameResponseStatusOk      HostnameResponseStatus = "ok"
	HostnameResponseStatusSkipped HostnameResponseStatus = "skipped"
	HostnameResponseStatusTimeout HostnameResponseStatus = "timeout"
)

Defines values for HostnameResponseStatus.

func (HostnameResponseStatus) Valid

func (e HostnameResponseStatus) Valid() bool

Valid indicates whether the value is a known member of the HostnameResponseStatus enum.

type HostnameUpdateCollectionResponse

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

HostnameUpdateCollectionResponse defines model for HostnameUpdateCollectionResponse.

type HostnameUpdateRequest

type HostnameUpdateRequest struct {
	// Hostname The new hostname to set.
	Hostname string `json:"hostname" validate:"required,min=1,max=253"`
}

HostnameUpdateRequest defines model for HostnameUpdateRequest.

type HostnameUpdateResultItem

type HostnameUpdateResultItem struct {
	// Changed Whether the hostname was actually modified.
	Changed *bool   `json:"changed,omitempty"`
	Error   *string `json:"error,omitempty"`

	// Hostname The hostname of the agent.
	Hostname string                         `json:"hostname"`
	Status   HostnameUpdateResultItemStatus `json:"status"`
}

HostnameUpdateResultItem defines model for HostnameUpdateResultItem.

type HostnameUpdateResultItemStatus

type HostnameUpdateResultItemStatus string

HostnameUpdateResultItemStatus defines model for HostnameUpdateResultItem.Status.

const (
	HostnameUpdateResultItemStatusFailed  HostnameUpdateResultItemStatus = "failed"
	HostnameUpdateResultItemStatusOk      HostnameUpdateResultItemStatus = "ok"
	HostnameUpdateResultItemStatusSkipped HostnameUpdateResultItemStatus = "skipped"
	HostnameUpdateResultItemStatusTimeout HostnameUpdateResultItemStatus = "timeout"
)

Defines values for HostnameUpdateResultItemStatus.

func (HostnameUpdateResultItemStatus) Valid

Valid indicates whether the value is a known member of the HostnameUpdateResultItemStatus enum.

type PutNodeHostname202JSONResponse

type PutNodeHostname202JSONResponse HostnameUpdateCollectionResponse

func (PutNodeHostname202JSONResponse) VisitPutNodeHostnameResponse

func (response PutNodeHostname202JSONResponse) VisitPutNodeHostnameResponse(w http.ResponseWriter) error

type PutNodeHostname400JSONResponse

type PutNodeHostname400JSONResponse externalRef0.ErrorResponse

func (PutNodeHostname400JSONResponse) VisitPutNodeHostnameResponse

func (response PutNodeHostname400JSONResponse) VisitPutNodeHostnameResponse(w http.ResponseWriter) error

type PutNodeHostname401JSONResponse

type PutNodeHostname401JSONResponse externalRef0.ErrorResponse

func (PutNodeHostname401JSONResponse) VisitPutNodeHostnameResponse

func (response PutNodeHostname401JSONResponse) VisitPutNodeHostnameResponse(w http.ResponseWriter) error

type PutNodeHostname403JSONResponse

type PutNodeHostname403JSONResponse externalRef0.ErrorResponse

func (PutNodeHostname403JSONResponse) VisitPutNodeHostnameResponse

func (response PutNodeHostname403JSONResponse) VisitPutNodeHostnameResponse(w http.ResponseWriter) error

type PutNodeHostname500JSONResponse

type PutNodeHostname500JSONResponse externalRef0.ErrorResponse

func (PutNodeHostname500JSONResponse) VisitPutNodeHostnameResponse

func (response PutNodeHostname500JSONResponse) VisitPutNodeHostnameResponse(w http.ResponseWriter) error

type PutNodeHostnameJSONRequestBody

type PutNodeHostnameJSONRequestBody = HostnameUpdateRequest

PutNodeHostnameJSONRequestBody defines body for PutNodeHostname for application/json ContentType.

type PutNodeHostnameRequestObject

type PutNodeHostnameRequestObject struct {
	Hostname Hostname `json:"hostname" validate:"required,min=1,valid_target"`
	Body     *PutNodeHostnameJSONRequestBody
}

type PutNodeHostnameResponseObject

type PutNodeHostnameResponseObject interface {
	VisitPutNodeHostnameResponse(w http.ResponseWriter) error
}

type RegisterHandlersOptions

type RegisterHandlersOptions struct {
	// BaseURL is prepended to every registered path so the API can be served
	// under a prefix.
	BaseURL string
	// OperationMiddlewares lets the caller attach per-operation middleware at
	// registration time. The map key is the OpenAPI `operationId` value as it
	// appears in the spec (the raw, un-normalized form). Operations that have
	// no entry are registered with no extra middleware. A nil map disables
	// per-operation middleware entirely.
	OperationMiddlewares map[string][]echo.MiddlewareFunc
}

RegisterHandlersOptions configures RegisterHandlersWithOptions.

type ServerInterface

type ServerInterface interface {
	// Retrieve node hostname
	// (GET /api/node/{hostname}/hostname)
	GetNodeHostname(ctx *echo.Context, hostname Hostname) error
	// Update node hostname
	// (PUT /api/node/{hostname}/hostname)
	PutNodeHostname(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) GetNodeHostname

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

GetNodeHostname converts echo context to params.

func (*ServerInterfaceWrapper) PutNodeHostname

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

PutNodeHostname converts echo context to params.

type StrictHandlerFunc

type StrictHandlerFunc func(ctx *echo.Context, request any) (any, error)

type StrictMiddlewareFunc

type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc

type StrictServerInterface

type StrictServerInterface interface {
	// Retrieve node hostname
	// (GET /api/node/{hostname}/hostname)
	GetNodeHostname(ctx context.Context, request GetNodeHostnameRequestObject) (GetNodeHostnameResponseObject, error)
	// Update node hostname
	// (PUT /api/node/{hostname}/hostname)
	PutNodeHostname(ctx context.Context, request PutNodeHostnameRequestObject) (PutNodeHostnameResponseObject, error)
}

StrictServerInterface represents all server handlers.

Jump to

Keyboard shortcuts

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