{"modulePath":"github.com/osapi-io/osapi","version":"v0.2.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package gen\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\nPackage gen contains generated code for the command API.\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 CommandExecRequest struct {\n\t// Args Command arguments.\n\tArgs *[]string `json:\"args,omitempty\"`\n\n\t// Command The executable name or path.\n\tCommand string `json:\"command\" validate:\"required,min=1\"`\n\n\t// Cwd Working directory for the command.\n\tCwd *string `json:\"cwd,omitempty\"`\n\n\t// Timeout Timeout in seconds (default 30, max 300).\n\tTimeout *int `json:\"timeout,omitempty\" validate:\"omitempty,min=1,max=300\"`\n}\n```\nCommandExecRequest defines model for CommandExecRequest.\n\n```go\ntype CommandResultCollectionResponse struct {\n\t// JobId The job ID used to process this request.\n\tJobId   *openapi_types.UUID `json:\"job_id,omitempty\"`\n\tResults []CommandResultItem `json:\"results\"`\n}\n```\nCommandResultCollectionResponse defines model for CommandResultCollectionResponse.\n\n```go\ntype CommandResultItem struct {\n\t// Changed Whether the command modified system state.\n\tChanged *bool `json:\"changed,omitempty\"`\n\n\t// DurationMs Execution time in milliseconds.\n\tDurationMs *int64 `json:\"duration_ms,omitempty\"`\n\n\t// Error Error message if the agent failed.\n\tError *string `json:\"error,omitempty\"`\n\n\t// ExitCode Exit code of the command.\n\tExitCode *int `json:\"exit_code,omitempty\"`\n\n\t// Hostname The hostname of the agent that executed the command.\n\tHostname string `json:\"hostname\"`\n\n\t// Status The status of the operation for this host.\n\tStatus CommandResultItemStatus `json:\"status\"`\n\n\t// Stderr Standard error output of the command.\n\tStderr *string `json:\"stderr,omitempty\"`\n\n\t// Stdout Standard output of the command.\n\tStdout *string `json:\"stdout,omitempty\"`\n}\n```\nCommandResultItem defines model for CommandResultItem.\n\n```go\ntype CommandResultItemStatus string\n```\nCommandResultItemStatus The status of the operation for this host.\n\n```go\nconst (\n\tFailed  CommandResultItemStatus = \"failed\"\n\tOk      CommandResultItemStatus = \"ok\"\n\tSkipped CommandResultItemStatus = \"skipped\"\n\tTimeout CommandResultItemStatus = \"timeout\"\n)\n```\nDefines values for CommandResultItemStatus.\n\n```go\nfunc (e CommandResultItemStatus) Valid() bool\n```\nValid indicates whether the value is a known member of the CommandResultItemStatus enum.\n\n```go\ntype CommandShellRequest struct {\n\t// Command The full shell command string.\n\tCommand string `json:\"command\" validate:\"required,min=1\"`\n\n\t// Cwd Working directory for the command.\n\tCwd *string `json:\"cwd,omitempty\"`\n\n\t// Timeout Timeout in seconds (default 30, max 300).\n\tTimeout *int `json:\"timeout,omitempty\" validate:\"omitempty,min=1,max=300\"`\n}\n```\nCommandShellRequest defines model for CommandShellRequest.\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 PostNodeCommandExec202JSONResponse CommandResultCollectionResponse\n```\n\n```go\nfunc (response PostNodeCommandExec202JSONResponse) VisitPostNodeCommandExecResponse(w http.ResponseWriter) error\n```\n\n```go\ntype PostNodeCommandExec400JSONResponse externalRef0.ErrorResponse\n```\n\n```go\nfunc (response PostNodeCommandExec400JSONResponse) VisitPostNodeCommandExecResponse(w http.ResponseWriter) error\n```\n\n```go\ntype PostNodeCommandExec401JSONResponse externalRef0.ErrorResponse\n```\n\n```go\nfunc (response PostNodeCommandExec401JSONResponse) VisitPostNodeCommandExecResponse(w http.ResponseWriter) error\n```\n\n```go\ntype PostNodeCommandExec403JSONResponse externalRef0.ErrorResponse\n```\n\n```go\nfunc (response PostNodeCommandExec403JSONResponse) VisitPostNodeCommandExecResponse(w http.ResponseWriter) error\n```\n\n```go\ntype PostNodeCommandExec500JSONResponse externalRef0.ErrorResponse\n```\n\n```go\nfunc (response PostNodeCommandExec500JSONResponse) VisitPostNodeCommandExecResponse(w http.ResponseWriter) error\n```\n\n```go\ntype PostNodeCommandExecJSONRequestBody = CommandExecRequest\n```\nPostNodeCommandExecJSONRequestBody defines body for PostNodeCommandExec for application/json ContentType.\n\n```go\ntype PostNodeCommandExecRequestObject struct {\n\tHostname Hostname `json:\"hostname\" validate:\"required,min=1,valid_target\"`\n\tBody     *PostNodeCommandExecJSONRequestBody\n}\n```\n\n```go\ntype PostNodeCommandExecResponseObject interface {\n\tVisitPostNodeCommandExecResponse(w http.ResponseWriter) error\n}\n```\n\n```go\ntype PostNodeCommandShell202JSONResponse CommandResultCollectionResponse\n```\n\n```go\nfunc (response PostNodeCommandShell202JSONResponse) VisitPostNodeCommandShellResponse(w http.ResponseWriter) error\n```\n\n```go\ntype PostNodeCommandShell400JSONResponse externalRef0.ErrorResponse\n```\n\n```go\nfunc (response PostNodeCommandShell400JSONResponse) VisitPostNodeCommandShellResponse(w http.ResponseWriter) error\n```\n\n```go\ntype PostNodeCommandShell401JSONResponse externalRef0.ErrorResponse\n```\n\n```go\nfunc (response PostNodeCommandShell401JSONResponse) VisitPostNodeCommandShellResponse(w http.ResponseWriter) error\n```\n\n```go\ntype PostNodeCommandShell403JSONResponse externalRef0.ErrorResponse\n```\n\n```go\nfunc (response PostNodeCommandShell403JSONResponse) VisitPostNodeCommandShellResponse(w http.ResponseWriter) error\n```\n\n```go\ntype PostNodeCommandShell500JSONResponse externalRef0.ErrorResponse\n```\n\n```go\nfunc (response PostNodeCommandShell500JSONResponse) VisitPostNodeCommandShellResponse(w http.ResponseWriter) error\n```\n\n```go\ntype PostNodeCommandShellJSONRequestBody = CommandShellRequest\n```\nPostNodeCommandShellJSONRequestBody defines body for PostNodeCommandShell for application/json ContentType.\n\n```go\ntype PostNodeCommandShellRequestObject struct {\n\tHostname Hostname `json:\"hostname\" validate:\"required,min=1,valid_target\"`\n\tBody     *PostNodeCommandShellJSONRequestBody\n}\n```\n\n```go\ntype PostNodeCommandShellResponseObject interface {\n\tVisitPostNodeCommandShellResponse(w http.ResponseWriter) error\n}\n```\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// Execute a command\n\t// (POST /api/node/{hostname}/command/exec)\n\tPostNodeCommandExec(ctx *echo.Context, hostname Hostname) error\n\t// Execute a shell command\n\t// (POST /api/node/{hostname}/command/shell)\n\tPostNodeCommandShell(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) PostNodeCommandExec(ctx *echo.Context) error\n```\nPostNodeCommandExec converts echo context to params.\n\n```go\nfunc (w *ServerInterfaceWrapper) PostNodeCommandShell(ctx *echo.Context) error\n```\nPostNodeCommandShell 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// Execute a command\n\t// (POST /api/node/{hostname}/command/exec)\n\tPostNodeCommandExec(ctx context.Context, request PostNodeCommandExecRequestObject) (PostNodeCommandExecResponseObject, error)\n\t// Execute a shell command\n\t// (POST /api/node/{hostname}/command/shell)\n\tPostNodeCommandShell(ctx context.Context, request PostNodeCommandShellRequestObject) (PostNodeCommandShellResponseObject, error)\n}\n```\nStrictServerInterface represents all server handlers.\n\n","path":"github.com/osapi-io/osapi/internal/controller/api/node/command/gen","name":"gen","synopsis":"Package gen provides primitives to interact with the openapi HTTP API.","isRedistributable":true}
