{"modulePath":"github.com/osapi-io/osapi","version":"v0.2.0","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package gen\n\nPackage gen contains generated code for the Power API.\n\nPackage gen provides primitives to interact with the openapi HTTP API.\n\nCode generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.1 DO NOT EDIT.\n\n## Constants\n\n```go\nconst (\n\tBearerAuthScopes bearerAuthContextKey = \"BearerAuth.Scopes\"\n)\n```\n\n## Functions\n\n```go\nfunc RegisterHandlers(router EchoRouter, si ServerInterface)\n```\nRegisterHandlers adds each server route to the EchoRouter.\n\n```go\nfunc RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)\n```\nRegisterHandlersWithBaseURL registers handlers and prepends BaseURL to the paths so the API can be served under a prefix.\n\n```go\nfunc RegisterHandlersWithOptions(router EchoRouter, si ServerInterface, options RegisterHandlersOptions)\n```\nRegisterHandlersWithOptions registers handlers using the supplied options, including any per-operation middleware.\n\n## Types\n\n```go\ntype EchoRouter interface {\n\tCONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echo.RouteInfo\n\tDELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echo.RouteInfo\n\tGET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echo.RouteInfo\n\tHEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echo.RouteInfo\n\tOPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echo.RouteInfo\n\tPATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echo.RouteInfo\n\tPOST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echo.RouteInfo\n\tPUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echo.RouteInfo\n\tTRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) echo.RouteInfo\n}\n```\nThis 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\n\n```go\ntype ErrorResponse = externalRef0.ErrorResponse\n```\nErrorResponse defines model for ErrorResponse.\n\n```go\ntype Hostname = string\n```\nHostname defines model for Hostname.\n\n```go\ntype PostNodePowerReboot200JSONResponse PowerRebootResponse\n```\n\n```go\nfunc (response PostNodePowerReboot200JSONResponse) VisitPostNodePowerRebootResponse(w http.ResponseWriter) error\n```\n\n```go\ntype PostNodePowerReboot400JSONResponse externalRef0.ErrorResponse\n```\n\n```go\nfunc (response PostNodePowerReboot400JSONResponse) VisitPostNodePowerRebootResponse(w http.ResponseWriter) error\n```\n\n```go\ntype PostNodePowerReboot401JSONResponse externalRef0.ErrorResponse\n```\n\n```go\nfunc (response PostNodePowerReboot401JSONResponse) VisitPostNodePowerRebootResponse(w http.ResponseWriter) error\n```\n\n```go\ntype PostNodePowerReboot403JSONResponse externalRef0.ErrorResponse\n```\n\n```go\nfunc (response PostNodePowerReboot403JSONResponse) VisitPostNodePowerRebootResponse(w http.ResponseWriter) error\n```\n\n```go\ntype PostNodePowerReboot500JSONResponse externalRef0.ErrorResponse\n```\n\n```go\nfunc (response PostNodePowerReboot500JSONResponse) VisitPostNodePowerRebootResponse(w http.ResponseWriter) error\n```\n\n```go\ntype PostNodePowerRebootJSONRequestBody = PowerRequest\n```\nPostNodePowerRebootJSONRequestBody defines body for PostNodePowerReboot for application/json ContentType.\n\n```go\ntype PostNodePowerRebootRequestObject struct {\n\tHostname Hostname `json:\"hostname\" validate:\"required,min=1,valid_target\"`\n\tBody     *PostNodePowerRebootJSONRequestBody\n}\n```\n\n```go\ntype PostNodePowerRebootResponseObject interface {\n\tVisitPostNodePowerRebootResponse(w http.ResponseWriter) error\n}\n```\n\n```go\ntype PostNodePowerShutdown200JSONResponse PowerShutdownResponse\n```\n\n```go\nfunc (response PostNodePowerShutdown200JSONResponse) VisitPostNodePowerShutdownResponse(w http.ResponseWriter) error\n```\n\n```go\ntype PostNodePowerShutdown400JSONResponse externalRef0.ErrorResponse\n```\n\n```go\nfunc (response PostNodePowerShutdown400JSONResponse) VisitPostNodePowerShutdownResponse(w http.ResponseWriter) error\n```\n\n```go\ntype PostNodePowerShutdown401JSONResponse externalRef0.ErrorResponse\n```\n\n```go\nfunc (response PostNodePowerShutdown401JSONResponse) VisitPostNodePowerShutdownResponse(w http.ResponseWriter) error\n```\n\n```go\ntype PostNodePowerShutdown403JSONResponse externalRef0.ErrorResponse\n```\n\n```go\nfunc (response PostNodePowerShutdown403JSONResponse) VisitPostNodePowerShutdownResponse(w http.ResponseWriter) error\n```\n\n```go\ntype PostNodePowerShutdown500JSONResponse externalRef0.ErrorResponse\n```\n\n```go\nfunc (response PostNodePowerShutdown500JSONResponse) VisitPostNodePowerShutdownResponse(w http.ResponseWriter) error\n```\n\n```go\ntype PostNodePowerShutdownJSONRequestBody = PowerRequest\n```\nPostNodePowerShutdownJSONRequestBody defines body for PostNodePowerShutdown for application/json ContentType.\n\n```go\ntype PostNodePowerShutdownRequestObject struct {\n\tHostname Hostname `json:\"hostname\" validate:\"required,min=1,valid_target\"`\n\tBody     *PostNodePowerShutdownJSONRequestBody\n}\n```\n\n```go\ntype PostNodePowerShutdownResponseObject interface {\n\tVisitPostNodePowerShutdownResponse(w http.ResponseWriter) error\n}\n```\n\n```go\ntype PowerRebootResponse struct {\n\t// JobId The job ID used to process this request.\n\tJobId   *openapi_types.UUID `json:\"job_id,omitempty\"`\n\tResults []PowerResult       `json:\"results\"`\n}\n```\nPowerRebootResponse defines model for PowerRebootResponse.\n\n```go\ntype PowerRequest struct {\n\t// Delay Delay in seconds before the operation is executed.\n\tDelay *int `json:\"delay,omitempty\" validate:\"omitempty,min=0\"`\n\n\t// Message Optional message to broadcast before the operation.\n\tMessage *string `json:\"message,omitempty\" validate:\"omitempty\"`\n}\n```\nPowerRequest defines model for PowerRequest.\n\n```go\ntype PowerResult struct {\n\t// Action The power action performed (reboot, shutdown).\n\tAction *string `json:\"action,omitempty\"`\n\n\t// Changed Whether the operation modified system state.\n\tChanged *bool `json:\"changed,omitempty\"`\n\n\t// Delay The delay in seconds before the operation executes.\n\tDelay *int `json:\"delay,omitempty\"`\n\n\t// Error Error message if the agent failed.\n\tError *string `json:\"error,omitempty\"`\n\n\t// Hostname Hostname of the agent that processed this operation.\n\tHostname string `json:\"hostname\"`\n\n\t// Status The status of the operation for this host.\n\tStatus PowerResultStatus `json:\"status\"`\n}\n```\nPowerResult Result of a power operation for one host.\n\n```go\ntype PowerResultStatus string\n```\nPowerResultStatus The status of the operation for this host.\n\n```go\nconst (\n\tFailed  PowerResultStatus = \"failed\"\n\tOk      PowerResultStatus = \"ok\"\n\tSkipped PowerResultStatus = \"skipped\"\n\tTimeout PowerResultStatus = \"timeout\"\n)\n```\nDefines values for PowerResultStatus.\n\n```go\nfunc (e PowerResultStatus) Valid() bool\n```\nValid indicates whether the value is a known member of the PowerResultStatus enum.\n\n```go\ntype PowerShutdownResponse struct {\n\t// JobId The job ID used to process this request.\n\tJobId   *openapi_types.UUID `json:\"job_id,omitempty\"`\n\tResults []PowerResult       `json:\"results\"`\n}\n```\nPowerShutdownResponse defines model for PowerShutdownResponse.\n\n```go\ntype RegisterHandlersOptions struct {\n\t// BaseURL is prepended to every registered path so the API can be served\n\t// under a prefix.\n\tBaseURL string\n\t// OperationMiddlewares lets the caller attach per-operation middleware at\n\t// registration time. The map key is the OpenAPI `operationId` value as it\n\t// appears in the spec (the raw, un-normalized form). Operations that have\n\t// no entry are registered with no extra middleware. A nil map disables\n\t// per-operation middleware entirely.\n\tOperationMiddlewares map[string][]echo.MiddlewareFunc\n}\n```\nRegisterHandlersOptions configures RegisterHandlersWithOptions.\n\n```go\ntype ServerInterface interface {\n\t// Reboot node\n\t// (POST /api/node/{hostname}/power/reboot)\n\tPostNodePowerReboot(ctx *echo.Context, hostname Hostname) error\n\t// Shutdown node\n\t// (POST /api/node/{hostname}/power/shutdown)\n\tPostNodePowerShutdown(ctx *echo.Context, hostname Hostname) error\n}\n```\nServerInterface represents all server handlers.\n\n```go\nfunc NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface\n```\n\n```go\ntype ServerInterfaceWrapper struct {\n\tHandler ServerInterface\n}\n```\nServerInterfaceWrapper converts echo contexts to parameters.\n\n```go\nfunc (w *ServerInterfaceWrapper) PostNodePowerReboot(ctx *echo.Context) error\n```\nPostNodePowerReboot converts echo context to params.\n\n```go\nfunc (w *ServerInterfaceWrapper) PostNodePowerShutdown(ctx *echo.Context) error\n```\nPostNodePowerShutdown converts echo context to params.\n\n```go\ntype StrictHandlerFunc func(ctx *echo.Context, request any) (any, error)\n```\n\n```go\ntype StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc\n```\n\n```go\ntype StrictServerInterface interface {\n\t// Reboot node\n\t// (POST /api/node/{hostname}/power/reboot)\n\tPostNodePowerReboot(ctx context.Context, request PostNodePowerRebootRequestObject) (PostNodePowerRebootResponseObject, error)\n\t// Shutdown node\n\t// (POST /api/node/{hostname}/power/shutdown)\n\tPostNodePowerShutdown(ctx context.Context, request PostNodePowerShutdownRequestObject) (PostNodePowerShutdownResponseObject, error)\n}\n```\nStrictServerInterface represents all server handlers.\n\n","path":"github.com/osapi-io/osapi/internal/controller/api/node/power/gen","name":"gen","synopsis":"Package gen contains generated code for the Power API.","isRedistributable":true}
