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 NTP 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 DeleteNodeNtp200JSONResponse

type DeleteNodeNtp200JSONResponse NtpDeleteResponse

func (DeleteNodeNtp200JSONResponse) VisitDeleteNodeNtpResponse

func (response DeleteNodeNtp200JSONResponse) VisitDeleteNodeNtpResponse(w http.ResponseWriter) error

type DeleteNodeNtp400JSONResponse

type DeleteNodeNtp400JSONResponse externalRef0.ErrorResponse

func (DeleteNodeNtp400JSONResponse) VisitDeleteNodeNtpResponse

func (response DeleteNodeNtp400JSONResponse) VisitDeleteNodeNtpResponse(w http.ResponseWriter) error

type DeleteNodeNtp401JSONResponse

type DeleteNodeNtp401JSONResponse externalRef0.ErrorResponse

func (DeleteNodeNtp401JSONResponse) VisitDeleteNodeNtpResponse

func (response DeleteNodeNtp401JSONResponse) VisitDeleteNodeNtpResponse(w http.ResponseWriter) error

type DeleteNodeNtp403JSONResponse

type DeleteNodeNtp403JSONResponse externalRef0.ErrorResponse

func (DeleteNodeNtp403JSONResponse) VisitDeleteNodeNtpResponse

func (response DeleteNodeNtp403JSONResponse) VisitDeleteNodeNtpResponse(w http.ResponseWriter) error

type DeleteNodeNtp404JSONResponse

type DeleteNodeNtp404JSONResponse externalRef0.ErrorResponse

func (DeleteNodeNtp404JSONResponse) VisitDeleteNodeNtpResponse

func (response DeleteNodeNtp404JSONResponse) VisitDeleteNodeNtpResponse(w http.ResponseWriter) error

type DeleteNodeNtp500JSONResponse

type DeleteNodeNtp500JSONResponse externalRef0.ErrorResponse

func (DeleteNodeNtp500JSONResponse) VisitDeleteNodeNtpResponse

func (response DeleteNodeNtp500JSONResponse) VisitDeleteNodeNtpResponse(w http.ResponseWriter) error

type DeleteNodeNtpRequestObject

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

type DeleteNodeNtpResponseObject

type DeleteNodeNtpResponseObject interface {
	VisitDeleteNodeNtpResponse(w http.ResponseWriter) error
}

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 GetNodeNtp200JSONResponse

type GetNodeNtp200JSONResponse NtpCollectionResponse

func (GetNodeNtp200JSONResponse) VisitGetNodeNtpResponse

func (response GetNodeNtp200JSONResponse) VisitGetNodeNtpResponse(w http.ResponseWriter) error

type GetNodeNtp400JSONResponse

type GetNodeNtp400JSONResponse externalRef0.ErrorResponse

func (GetNodeNtp400JSONResponse) VisitGetNodeNtpResponse

func (response GetNodeNtp400JSONResponse) VisitGetNodeNtpResponse(w http.ResponseWriter) error

type GetNodeNtp401JSONResponse

type GetNodeNtp401JSONResponse externalRef0.ErrorResponse

func (GetNodeNtp401JSONResponse) VisitGetNodeNtpResponse

func (response GetNodeNtp401JSONResponse) VisitGetNodeNtpResponse(w http.ResponseWriter) error

type GetNodeNtp403JSONResponse

type GetNodeNtp403JSONResponse externalRef0.ErrorResponse

func (GetNodeNtp403JSONResponse) VisitGetNodeNtpResponse

func (response GetNodeNtp403JSONResponse) VisitGetNodeNtpResponse(w http.ResponseWriter) error

type GetNodeNtp500JSONResponse

type GetNodeNtp500JSONResponse externalRef0.ErrorResponse

func (GetNodeNtp500JSONResponse) VisitGetNodeNtpResponse

func (response GetNodeNtp500JSONResponse) VisitGetNodeNtpResponse(w http.ResponseWriter) error

type GetNodeNtpRequestObject

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

type GetNodeNtpResponseObject

type GetNodeNtpResponseObject interface {
	VisitGetNodeNtpResponse(w http.ResponseWriter) error
}

type Hostname

type Hostname = string

Hostname defines model for Hostname.

type NtpCollectionResponse

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

NtpCollectionResponse defines model for NtpCollectionResponse.

type NtpCreateRequest

type NtpCreateRequest struct {
	// Servers List of NTP server addresses to configure.
	Servers []string `json:"servers" validate:"required,min=1"`
}

NtpCreateRequest defines model for NtpCreateRequest.

type NtpCreateResponse

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

NtpCreateResponse defines model for NtpCreateResponse.

type NtpDeleteResponse

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

NtpDeleteResponse defines model for NtpDeleteResponse.

type NtpMutationResult

type NtpMutationResult 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 Hostname of the agent that processed this operation.
	Hostname string `json:"hostname"`

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

NtpMutationResult Result of an NTP create, update, or delete operation for one host.

type NtpMutationResultStatus

type NtpMutationResultStatus string

NtpMutationResultStatus The status of the operation for this host.

const (
	NtpMutationResultStatusFailed  NtpMutationResultStatus = "failed"
	NtpMutationResultStatusOk      NtpMutationResultStatus = "ok"
	NtpMutationResultStatusSkipped NtpMutationResultStatus = "skipped"
	NtpMutationResultStatusTimeout NtpMutationResultStatus = "timeout"
)

Defines values for NtpMutationResultStatus.

func (NtpMutationResultStatus) Valid

func (e NtpMutationResultStatus) Valid() bool

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

type NtpStatusEntry

type NtpStatusEntry struct {
	// CurrentSource The currently selected NTP source.
	CurrentSource *string `json:"current_source,omitempty"`

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

	// Hostname Hostname of the agent that reported this entry.
	Hostname string `json:"hostname"`

	// Offset Clock offset from the NTP source.
	Offset *string `json:"offset,omitempty"`

	// Servers Configured NTP server addresses.
	Servers *[]string `json:"servers,omitempty"`

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

	// Stratum NTP stratum level.
	Stratum *int `json:"stratum,omitempty"`

	// Synchronized Whether the system clock is synchronized.
	Synchronized *bool `json:"synchronized,omitempty"`
}

NtpStatusEntry NTP status for a single host.

type NtpStatusEntryStatus

type NtpStatusEntryStatus string

NtpStatusEntryStatus The status of the operation for this host.

const (
	NtpStatusEntryStatusFailed  NtpStatusEntryStatus = "failed"
	NtpStatusEntryStatusOk      NtpStatusEntryStatus = "ok"
	NtpStatusEntryStatusSkipped NtpStatusEntryStatus = "skipped"
	NtpStatusEntryStatusTimeout NtpStatusEntryStatus = "timeout"
)

Defines values for NtpStatusEntryStatus.

func (NtpStatusEntryStatus) Valid

func (e NtpStatusEntryStatus) Valid() bool

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

type NtpUpdateRequest

type NtpUpdateRequest struct {
	// Servers List of NTP server addresses to configure.
	Servers []string `json:"servers" validate:"required,min=1"`
}

NtpUpdateRequest defines model for NtpUpdateRequest.

type NtpUpdateResponse

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

NtpUpdateResponse defines model for NtpUpdateResponse.

type PostNodeNtp200JSONResponse

type PostNodeNtp200JSONResponse NtpCreateResponse

func (PostNodeNtp200JSONResponse) VisitPostNodeNtpResponse

func (response PostNodeNtp200JSONResponse) VisitPostNodeNtpResponse(w http.ResponseWriter) error

type PostNodeNtp400JSONResponse

type PostNodeNtp400JSONResponse externalRef0.ErrorResponse

func (PostNodeNtp400JSONResponse) VisitPostNodeNtpResponse

func (response PostNodeNtp400JSONResponse) VisitPostNodeNtpResponse(w http.ResponseWriter) error

type PostNodeNtp401JSONResponse

type PostNodeNtp401JSONResponse externalRef0.ErrorResponse

func (PostNodeNtp401JSONResponse) VisitPostNodeNtpResponse

func (response PostNodeNtp401JSONResponse) VisitPostNodeNtpResponse(w http.ResponseWriter) error

type PostNodeNtp403JSONResponse

type PostNodeNtp403JSONResponse externalRef0.ErrorResponse

func (PostNodeNtp403JSONResponse) VisitPostNodeNtpResponse

func (response PostNodeNtp403JSONResponse) VisitPostNodeNtpResponse(w http.ResponseWriter) error

type PostNodeNtp500JSONResponse

type PostNodeNtp500JSONResponse externalRef0.ErrorResponse

func (PostNodeNtp500JSONResponse) VisitPostNodeNtpResponse

func (response PostNodeNtp500JSONResponse) VisitPostNodeNtpResponse(w http.ResponseWriter) error

type PostNodeNtpJSONRequestBody

type PostNodeNtpJSONRequestBody = NtpCreateRequest

PostNodeNtpJSONRequestBody defines body for PostNodeNtp for application/json ContentType.

type PostNodeNtpRequestObject

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

type PostNodeNtpResponseObject

type PostNodeNtpResponseObject interface {
	VisitPostNodeNtpResponse(w http.ResponseWriter) error
}

type PutNodeNtp200JSONResponse

type PutNodeNtp200JSONResponse NtpUpdateResponse

func (PutNodeNtp200JSONResponse) VisitPutNodeNtpResponse

func (response PutNodeNtp200JSONResponse) VisitPutNodeNtpResponse(w http.ResponseWriter) error

type PutNodeNtp400JSONResponse

type PutNodeNtp400JSONResponse externalRef0.ErrorResponse

func (PutNodeNtp400JSONResponse) VisitPutNodeNtpResponse

func (response PutNodeNtp400JSONResponse) VisitPutNodeNtpResponse(w http.ResponseWriter) error

type PutNodeNtp401JSONResponse

type PutNodeNtp401JSONResponse externalRef0.ErrorResponse

func (PutNodeNtp401JSONResponse) VisitPutNodeNtpResponse

func (response PutNodeNtp401JSONResponse) VisitPutNodeNtpResponse(w http.ResponseWriter) error

type PutNodeNtp403JSONResponse

type PutNodeNtp403JSONResponse externalRef0.ErrorResponse

func (PutNodeNtp403JSONResponse) VisitPutNodeNtpResponse

func (response PutNodeNtp403JSONResponse) VisitPutNodeNtpResponse(w http.ResponseWriter) error

type PutNodeNtp404JSONResponse

type PutNodeNtp404JSONResponse externalRef0.ErrorResponse

func (PutNodeNtp404JSONResponse) VisitPutNodeNtpResponse

func (response PutNodeNtp404JSONResponse) VisitPutNodeNtpResponse(w http.ResponseWriter) error

type PutNodeNtp500JSONResponse

type PutNodeNtp500JSONResponse externalRef0.ErrorResponse

func (PutNodeNtp500JSONResponse) VisitPutNodeNtpResponse

func (response PutNodeNtp500JSONResponse) VisitPutNodeNtpResponse(w http.ResponseWriter) error

type PutNodeNtpJSONRequestBody

type PutNodeNtpJSONRequestBody = NtpUpdateRequest

PutNodeNtpJSONRequestBody defines body for PutNodeNtp for application/json ContentType.

type PutNodeNtpRequestObject

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

type PutNodeNtpResponseObject

type PutNodeNtpResponseObject interface {
	VisitPutNodeNtpResponse(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 {
	// Delete NTP configuration
	// (DELETE /api/node/{hostname}/ntp)
	DeleteNodeNtp(ctx *echo.Context, hostname Hostname) error
	// Get NTP status
	// (GET /api/node/{hostname}/ntp)
	GetNodeNtp(ctx *echo.Context, hostname Hostname) error
	// Create NTP configuration
	// (POST /api/node/{hostname}/ntp)
	PostNodeNtp(ctx *echo.Context, hostname Hostname) error
	// Update NTP configuration
	// (PUT /api/node/{hostname}/ntp)
	PutNodeNtp(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) DeleteNodeNtp

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

DeleteNodeNtp converts echo context to params.

func (*ServerInterfaceWrapper) GetNodeNtp

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

GetNodeNtp converts echo context to params.

func (*ServerInterfaceWrapper) PostNodeNtp

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

PostNodeNtp converts echo context to params.

func (*ServerInterfaceWrapper) PutNodeNtp

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

PutNodeNtp 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 {
	// Delete NTP configuration
	// (DELETE /api/node/{hostname}/ntp)
	DeleteNodeNtp(ctx context.Context, request DeleteNodeNtpRequestObject) (DeleteNodeNtpResponseObject, error)
	// Get NTP status
	// (GET /api/node/{hostname}/ntp)
	GetNodeNtp(ctx context.Context, request GetNodeNtpRequestObject) (GetNodeNtpResponseObject, error)
	// Create NTP configuration
	// (POST /api/node/{hostname}/ntp)
	PostNodeNtp(ctx context.Context, request PostNodeNtpRequestObject) (PostNodeNtpResponseObject, error)
	// Update NTP configuration
	// (PUT /api/node/{hostname}/ntp)
	PutNodeNtp(ctx context.Context, request PutNodeNtpRequestObject) (PutNodeNtpResponseObject, error)
}

StrictServerInterface represents all server handlers.

Jump to

Keyboard shortcuts

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