Documentation
¶
Overview ¶
Package gen contains generated code for the Timezone 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
- func RegisterHandlers(router EchoRouter, si ServerInterface)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
- func RegisterHandlersWithOptions(router EchoRouter, si ServerInterface, options RegisterHandlersOptions)
- type EchoRouter
- type ErrorResponse
- type GetNodeTimezone200JSONResponse
- type GetNodeTimezone400JSONResponse
- type GetNodeTimezone401JSONResponse
- type GetNodeTimezone403JSONResponse
- type GetNodeTimezone500JSONResponse
- type GetNodeTimezoneRequestObject
- type GetNodeTimezoneResponseObject
- type Hostname
- type PutNodeTimezone200JSONResponse
- type PutNodeTimezone400JSONResponse
- type PutNodeTimezone401JSONResponse
- type PutNodeTimezone403JSONResponse
- type PutNodeTimezone500JSONResponse
- type PutNodeTimezoneJSONRequestBody
- type PutNodeTimezoneRequestObject
- type PutNodeTimezoneResponseObject
- type RegisterHandlersOptions
- type ServerInterface
- type ServerInterfaceWrapper
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type TimezoneCollectionResponse
- type TimezoneEntry
- type TimezoneEntryStatus
- type TimezoneMutationResult
- type TimezoneMutationResultStatus
- type TimezoneUpdateRequest
- type TimezoneUpdateResponse
Constants ¶
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 ¶
type EchoRouter interface {
CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echo.RouteInfo
DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echo.RouteInfo
GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echo.RouteInfo
HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echo.RouteInfo
OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echo.RouteInfo
PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echo.RouteInfo
POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echo.RouteInfo
PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echo.RouteInfo
TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echo.RouteInfo
}
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 GetNodeTimezone200JSONResponse ¶
type GetNodeTimezone200JSONResponse TimezoneCollectionResponse
func (GetNodeTimezone200JSONResponse) VisitGetNodeTimezoneResponse ¶
func (response GetNodeTimezone200JSONResponse) VisitGetNodeTimezoneResponse(w http.ResponseWriter) error
type GetNodeTimezone400JSONResponse ¶
type GetNodeTimezone400JSONResponse externalRef0.ErrorResponse
func (GetNodeTimezone400JSONResponse) VisitGetNodeTimezoneResponse ¶
func (response GetNodeTimezone400JSONResponse) VisitGetNodeTimezoneResponse(w http.ResponseWriter) error
type GetNodeTimezone401JSONResponse ¶
type GetNodeTimezone401JSONResponse externalRef0.ErrorResponse
func (GetNodeTimezone401JSONResponse) VisitGetNodeTimezoneResponse ¶
func (response GetNodeTimezone401JSONResponse) VisitGetNodeTimezoneResponse(w http.ResponseWriter) error
type GetNodeTimezone403JSONResponse ¶
type GetNodeTimezone403JSONResponse externalRef0.ErrorResponse
func (GetNodeTimezone403JSONResponse) VisitGetNodeTimezoneResponse ¶
func (response GetNodeTimezone403JSONResponse) VisitGetNodeTimezoneResponse(w http.ResponseWriter) error
type GetNodeTimezone500JSONResponse ¶
type GetNodeTimezone500JSONResponse externalRef0.ErrorResponse
func (GetNodeTimezone500JSONResponse) VisitGetNodeTimezoneResponse ¶
func (response GetNodeTimezone500JSONResponse) VisitGetNodeTimezoneResponse(w http.ResponseWriter) error
type GetNodeTimezoneRequestObject ¶
type GetNodeTimezoneRequestObject struct {
Hostname Hostname `json:"hostname" validate:"required,min=1,valid_target"`
}
type GetNodeTimezoneResponseObject ¶
type GetNodeTimezoneResponseObject interface {
VisitGetNodeTimezoneResponse(w http.ResponseWriter) error
}
type PutNodeTimezone200JSONResponse ¶
type PutNodeTimezone200JSONResponse TimezoneUpdateResponse
func (PutNodeTimezone200JSONResponse) VisitPutNodeTimezoneResponse ¶
func (response PutNodeTimezone200JSONResponse) VisitPutNodeTimezoneResponse(w http.ResponseWriter) error
type PutNodeTimezone400JSONResponse ¶
type PutNodeTimezone400JSONResponse externalRef0.ErrorResponse
func (PutNodeTimezone400JSONResponse) VisitPutNodeTimezoneResponse ¶
func (response PutNodeTimezone400JSONResponse) VisitPutNodeTimezoneResponse(w http.ResponseWriter) error
type PutNodeTimezone401JSONResponse ¶
type PutNodeTimezone401JSONResponse externalRef0.ErrorResponse
func (PutNodeTimezone401JSONResponse) VisitPutNodeTimezoneResponse ¶
func (response PutNodeTimezone401JSONResponse) VisitPutNodeTimezoneResponse(w http.ResponseWriter) error
type PutNodeTimezone403JSONResponse ¶
type PutNodeTimezone403JSONResponse externalRef0.ErrorResponse
func (PutNodeTimezone403JSONResponse) VisitPutNodeTimezoneResponse ¶
func (response PutNodeTimezone403JSONResponse) VisitPutNodeTimezoneResponse(w http.ResponseWriter) error
type PutNodeTimezone500JSONResponse ¶
type PutNodeTimezone500JSONResponse externalRef0.ErrorResponse
func (PutNodeTimezone500JSONResponse) VisitPutNodeTimezoneResponse ¶
func (response PutNodeTimezone500JSONResponse) VisitPutNodeTimezoneResponse(w http.ResponseWriter) error
type PutNodeTimezoneJSONRequestBody ¶
type PutNodeTimezoneJSONRequestBody = TimezoneUpdateRequest
PutNodeTimezoneJSONRequestBody defines body for PutNodeTimezone for application/json ContentType.
type PutNodeTimezoneRequestObject ¶
type PutNodeTimezoneRequestObject struct {
Hostname Hostname `json:"hostname" validate:"required,min=1,valid_target"`
Body *PutNodeTimezoneJSONRequestBody
}
type PutNodeTimezoneResponseObject ¶
type PutNodeTimezoneResponseObject interface {
VisitPutNodeTimezoneResponse(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 {
// Get system timezone
// (GET /api/node/{hostname}/timezone)
GetNodeTimezone(ctx *echo.Context, hostname Hostname) error
// Update system timezone
// (PUT /api/node/{hostname}/timezone)
PutNodeTimezone(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) GetNodeTimezone ¶
func (w *ServerInterfaceWrapper) GetNodeTimezone(ctx *echo.Context) error
GetNodeTimezone converts echo context to params.
func (*ServerInterfaceWrapper) PutNodeTimezone ¶
func (w *ServerInterfaceWrapper) PutNodeTimezone(ctx *echo.Context) error
PutNodeTimezone converts echo context to params.
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc
type StrictServerInterface ¶
type StrictServerInterface interface {
// Get system timezone
// (GET /api/node/{hostname}/timezone)
GetNodeTimezone(ctx context.Context, request GetNodeTimezoneRequestObject) (GetNodeTimezoneResponseObject, error)
// Update system timezone
// (PUT /api/node/{hostname}/timezone)
PutNodeTimezone(ctx context.Context, request PutNodeTimezoneRequestObject) (PutNodeTimezoneResponseObject, error)
}
StrictServerInterface represents all server handlers.
type TimezoneCollectionResponse ¶
type TimezoneCollectionResponse struct {
// JobId The job ID used to process this request.
JobId *openapi_types.UUID `json:"job_id,omitempty"`
Results []TimezoneEntry `json:"results"`
}
TimezoneCollectionResponse defines model for TimezoneCollectionResponse.
type TimezoneEntry ¶
type TimezoneEntry struct {
// Error Error message if the agent failed.
Error *string `json:"error,omitempty"`
// Hostname Hostname of the agent that reported this entry.
Hostname string `json:"hostname"`
// Status The status of the operation for this host.
Status TimezoneEntryStatus `json:"status"`
// Timezone Current timezone name.
Timezone *string `json:"timezone,omitempty"`
// UtcOffset Current UTC offset (e.g., "-05:00").
UtcOffset *string `json:"utc_offset,omitempty"`
}
TimezoneEntry Timezone information for a single host.
type TimezoneEntryStatus ¶
type TimezoneEntryStatus string
TimezoneEntryStatus The status of the operation for this host.
const ( TimezoneEntryStatusFailed TimezoneEntryStatus = "failed" TimezoneEntryStatusOk TimezoneEntryStatus = "ok" TimezoneEntryStatusSkipped TimezoneEntryStatus = "skipped" TimezoneEntryStatusTimeout TimezoneEntryStatus = "timeout" )
Defines values for TimezoneEntryStatus.
func (TimezoneEntryStatus) Valid ¶
func (e TimezoneEntryStatus) Valid() bool
Valid indicates whether the value is a known member of the TimezoneEntryStatus enum.
type TimezoneMutationResult ¶
type TimezoneMutationResult 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 TimezoneMutationResultStatus `json:"status"`
// Timezone Timezone that was set.
Timezone *string `json:"timezone,omitempty"`
}
TimezoneMutationResult Result of a timezone update operation for one host.
type TimezoneMutationResultStatus ¶
type TimezoneMutationResultStatus string
TimezoneMutationResultStatus The status of the operation for this host.
const ( TimezoneMutationResultStatusFailed TimezoneMutationResultStatus = "failed" TimezoneMutationResultStatusOk TimezoneMutationResultStatus = "ok" TimezoneMutationResultStatusSkipped TimezoneMutationResultStatus = "skipped" TimezoneMutationResultStatusTimeout TimezoneMutationResultStatus = "timeout" )
Defines values for TimezoneMutationResultStatus.
func (TimezoneMutationResultStatus) Valid ¶
func (e TimezoneMutationResultStatus) Valid() bool
Valid indicates whether the value is a known member of the TimezoneMutationResultStatus enum.
type TimezoneUpdateRequest ¶
type TimezoneUpdateRequest struct {
// Timezone IANA timezone name (e.g., "America/New_York", "UTC").
Timezone string `json:"timezone" validate:"required,min=1"`
}
TimezoneUpdateRequest defines model for TimezoneUpdateRequest.
type TimezoneUpdateResponse ¶
type TimezoneUpdateResponse struct {
// JobId The job ID used to process this request.
JobId *openapi_types.UUID `json:"job_id,omitempty"`
Results []TimezoneMutationResult `json:"results"`
}
TimezoneUpdateResponse defines model for TimezoneUpdateResponse.