Documentation
¶
Overview ¶
Package server provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
Package server provides Web API for launchr actions.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func Run(ctx context.Context, app launchr.App, opts *RunOptions) error
- type ActionFull
- type ActionId
- type ActionRunInfo
- type ActionRunInfoId
- type ActionRunParams
- type ActionRunStatus
- type ActionRunStreamData
- type ActionRunStreamDataType
- type ActionShort
- type ChiServerOptions
- type CustomisationConfig
- type DefaultError
- type Error
- type GetRunningActionStreamsParams
- type InvalidParamFormatError
- type JSONSchema
- type Limit
- type MiddlewareFunc
- type Offset
- type RequiredHeaderError
- type RequiredParamError
- type RunActionJSONRequestBody
- type RunOptions
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) GetActionByID(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetActionJSONSchema(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetActions(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetCustomisationConfig(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetOneRunningActionByID(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetRunningActionStreams(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetRunningActionsByID(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetWizardByID(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetWizards(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) RunAction(w http.ResponseWriter, r *http.Request)
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type Unimplemented
- func (_ Unimplemented) GetActionByID(w http.ResponseWriter, r *http.Request, id ActionId)
- func (_ Unimplemented) GetActionJSONSchema(w http.ResponseWriter, r *http.Request, id ActionId)
- func (_ Unimplemented) GetActions(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) GetCustomisationConfig(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) GetOneRunningActionByID(w http.ResponseWriter, r *http.Request, id ActionId, runId ActionRunInfoId)
- func (_ Unimplemented) GetRunningActionStreams(w http.ResponseWriter, r *http.Request, id ActionId, runId ActionRunInfoId, ...)
- func (_ Unimplemented) GetRunningActionsByID(w http.ResponseWriter, r *http.Request, id ActionId)
- func (_ Unimplemented) GetWizardByID(w http.ResponseWriter, r *http.Request, id WizardId)
- func (_ Unimplemented) GetWizards(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) RunAction(w http.ResponseWriter, r *http.Request, id ActionId)
- type UnmarshalingParamError
- type WizardFull
- type WizardId
- type WizardShort
- type WizardStep
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
func Handler ¶
func Handler(si ServerInterface) http.Handler
Handler creates http.Handler with routing matching OpenAPI spec.
func HandlerFromMux ¶
func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerFromMuxWithBaseURL ¶
func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
func PathToRawSpec ¶
Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
Types ¶
type ActionFull ¶
type ActionFull struct { Description string `json:"description"` ID string `json:"id"` JSONSchema JSONSchema `json:"jsonschema"` Title string `json:"title"` UISchema map[string]interface{} `json:"uischema,omitempty"` }
ActionFull defines model for ActionFull.
type ActionRunInfo ¶
type ActionRunInfo struct { ID string `json:"id"` Status ActionRunStatus `json:"status"` }
ActionRunInfo defines model for ActionRunInfo.
type ActionRunInfoId ¶
type ActionRunInfoId = string
ActionRunInfoId defines model for ActionRunInfoId.
type ActionRunParams ¶
type ActionRunParams struct { Arguments action.InputParams `json:"arguments"` Changed *[]string `json:"changed,omitempty"` Options action.InputParams `json:"options"` }
ActionRunParams defines model for ActionRunParams.
type ActionRunStatus ¶ added in v0.7.0
type ActionRunStatus string
ActionRunStatus defines model for ActionRunStatus.
const ( ActionRunStatusCreated ActionRunStatus = "created" ActionRunStatusError ActionRunStatus = "error" ActionRunStatusFinished ActionRunStatus = "finished" ActionRunStatusRunning ActionRunStatus = "running" )
Defines values for ActionRunStatus.
type ActionRunStreamData ¶
type ActionRunStreamData struct { Content string `json:"content"` Count int `json:"count"` Offset int `json:"offset"` Type ActionRunStreamDataType `json:"type"` }
ActionRunStreamData defines model for ActionRunStreamData.
type ActionRunStreamDataType ¶
type ActionRunStreamDataType string
ActionRunStreamDataType defines model for ActionRunStreamData.Type.
const ( StdErr ActionRunStreamDataType = "stdErr" StdIn ActionRunStreamDataType = "stdIn" StdOut ActionRunStreamDataType = "stdOut" )
Defines values for ActionRunStreamDataType.
type ActionShort ¶
type ActionShort struct { Description string `json:"description"` ID string `json:"id"` Title string `json:"title"` }
ActionShort defines model for ActionShort.
type ChiServerOptions ¶
type ChiServerOptions struct { BaseURL string BaseRouter chi.Router Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type CustomisationConfig ¶ added in v0.1.0
type CustomisationConfig = map[string]interface{}
CustomisationConfig defines model for Customisation.
type GetRunningActionStreamsParams ¶
type GetRunningActionStreamsParams struct { // Offset number of elements to skip Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"` // Limit number of elements to return Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` }
GetRunningActionStreamsParams defines parameters for GetRunningActionStreams.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type RequiredHeaderError ¶
func (*RequiredHeaderError) Error ¶
func (e *RequiredHeaderError) Error() string
func (*RequiredHeaderError) Unwrap ¶
func (e *RequiredHeaderError) Unwrap() error
type RequiredParamError ¶
type RequiredParamError struct {
ParamName string
}
func (*RequiredParamError) Error ¶
func (e *RequiredParamError) Error() string
type RunActionJSONRequestBody ¶
type RunActionJSONRequestBody = ActionRunParams
RunActionJSONRequestBody defines body for RunAction for application/json ContentType.
type RunOptions ¶
type RunOptions struct { // Addr optionally specifies the TCP address in form "host:port" for the server to listen on. // If empty, :80 is used. Addr string // APIPrefix specifies subpath where Api is served. APIPrefix string // SwaggerJSON enables serving of swagger.json for swagger ui. SwaggerJSON bool SwaggerUIFS fs.FS // Client server. ClientFS fs.FS ProxyClient string }
RunOptions is a set of options for running openapi http server.
func (RunOptions) BaseURL ¶ added in v0.11.0
func (o RunOptions) BaseURL() string
BaseURL returns base url for run options.
type ServerInterface ¶
type ServerInterface interface { // Lists all actions // (GET /actions) GetActions(w http.ResponseWriter, r *http.Request) // Returns action by id // (GET /actions/{id}) GetActionByID(w http.ResponseWriter, r *http.Request, id ActionId) // runs action // (POST /actions/{id}) RunAction(w http.ResponseWriter, r *http.Request, id ActionId) // Returns running actions // (GET /actions/{id}/running) GetRunningActionsByID(w http.ResponseWriter, r *http.Request, id ActionId) // Returns action run info // (GET /actions/{id}/running/{runId}) GetOneRunningActionByID(w http.ResponseWriter, r *http.Request, id ActionId, runId ActionRunInfoId) // Returns running action streams // (GET /actions/{id}/running/{runId}/streams) GetRunningActionStreams(w http.ResponseWriter, r *http.Request, id ActionId, runId ActionRunInfoId, params GetRunningActionStreamsParams) // Returns action json schema // (GET /actions/{id}/schema.json) GetActionJSONSchema(w http.ResponseWriter, r *http.Request, id ActionId) // Customisation config // (GET /customisation) GetCustomisationConfig(w http.ResponseWriter, r *http.Request) // Lists all wizards // (GET /wizard) GetWizards(w http.ResponseWriter, r *http.Request) // Returns wizard by id // (GET /wizard/{id}) GetWizardByID(w http.ResponseWriter, r *http.Request, id WizardId) }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct { Handler ServerInterface HandlerMiddlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) GetActionByID ¶
func (siw *ServerInterfaceWrapper) GetActionByID(w http.ResponseWriter, r *http.Request)
GetActionByID operation middleware
func (*ServerInterfaceWrapper) GetActionJSONSchema ¶
func (siw *ServerInterfaceWrapper) GetActionJSONSchema(w http.ResponseWriter, r *http.Request)
GetActionJSONSchema operation middleware
func (*ServerInterfaceWrapper) GetActions ¶
func (siw *ServerInterfaceWrapper) GetActions(w http.ResponseWriter, r *http.Request)
GetActions operation middleware
func (*ServerInterfaceWrapper) GetCustomisationConfig ¶ added in v0.1.0
func (siw *ServerInterfaceWrapper) GetCustomisationConfig(w http.ResponseWriter, r *http.Request)
GetCustomisationConfig operation middleware
func (*ServerInterfaceWrapper) GetOneRunningActionByID ¶
func (siw *ServerInterfaceWrapper) GetOneRunningActionByID(w http.ResponseWriter, r *http.Request)
GetOneRunningActionByID operation middleware
func (*ServerInterfaceWrapper) GetRunningActionStreams ¶
func (siw *ServerInterfaceWrapper) GetRunningActionStreams(w http.ResponseWriter, r *http.Request)
GetRunningActionStreams operation middleware
func (*ServerInterfaceWrapper) GetRunningActionsByID ¶
func (siw *ServerInterfaceWrapper) GetRunningActionsByID(w http.ResponseWriter, r *http.Request)
GetRunningActionsByID operation middleware
func (*ServerInterfaceWrapper) GetWizardByID ¶ added in v0.13.0
func (siw *ServerInterfaceWrapper) GetWizardByID(w http.ResponseWriter, r *http.Request)
GetWizardByID operation middleware
func (*ServerInterfaceWrapper) GetWizards ¶ added in v0.13.0
func (siw *ServerInterfaceWrapper) GetWizards(w http.ResponseWriter, r *http.Request)
GetWizards operation middleware
func (*ServerInterfaceWrapper) RunAction ¶
func (siw *ServerInterfaceWrapper) RunAction(w http.ResponseWriter, r *http.Request)
RunAction operation middleware
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type Unimplemented ¶
type Unimplemented struct{}
func (Unimplemented) GetActionByID ¶
func (_ Unimplemented) GetActionByID(w http.ResponseWriter, r *http.Request, id ActionId)
Returns action by id (GET /actions/{id})
func (Unimplemented) GetActionJSONSchema ¶
func (_ Unimplemented) GetActionJSONSchema(w http.ResponseWriter, r *http.Request, id ActionId)
Returns action json schema (GET /actions/{id}/schema.json)
func (Unimplemented) GetActions ¶
func (_ Unimplemented) GetActions(w http.ResponseWriter, r *http.Request)
Lists all actions (GET /actions)
func (Unimplemented) GetCustomisationConfig ¶ added in v0.1.0
func (_ Unimplemented) GetCustomisationConfig(w http.ResponseWriter, r *http.Request)
Customisation config (GET /customisation)
func (Unimplemented) GetOneRunningActionByID ¶
func (_ Unimplemented) GetOneRunningActionByID(w http.ResponseWriter, r *http.Request, id ActionId, runId ActionRunInfoId)
Returns action run info (GET /actions/{id}/running/{runId})
func (Unimplemented) GetRunningActionStreams ¶
func (_ Unimplemented) GetRunningActionStreams(w http.ResponseWriter, r *http.Request, id ActionId, runId ActionRunInfoId, params GetRunningActionStreamsParams)
Returns running action streams (GET /actions/{id}/running/{runId}/streams)
func (Unimplemented) GetRunningActionsByID ¶
func (_ Unimplemented) GetRunningActionsByID(w http.ResponseWriter, r *http.Request, id ActionId)
Returns running actions (GET /actions/{id}/running)
func (Unimplemented) GetWizardByID ¶ added in v0.13.0
func (_ Unimplemented) GetWizardByID(w http.ResponseWriter, r *http.Request, id WizardId)
Returns wizard by id (GET /wizard/{id})
func (Unimplemented) GetWizards ¶ added in v0.13.0
func (_ Unimplemented) GetWizards(w http.ResponseWriter, r *http.Request)
Lists all wizards (GET /wizard)
func (Unimplemented) RunAction ¶
func (_ Unimplemented) RunAction(w http.ResponseWriter, r *http.Request, id ActionId)
runs action (POST /actions/{id})
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error
type WizardFull ¶ added in v0.13.0
type WizardFull struct { Description string `json:"description"` ID string `json:"id"` Steps []WizardStep `json:"steps"` Success string `json:"success"` Title string `json:"title"` }
WizardFull defines model for WizardFull.
type WizardShort ¶ added in v0.13.0
type WizardShort struct { Description string `json:"description"` ID string `json:"id"` Success string `json:"success"` Title string `json:"title"` }
WizardShort defines model for WizardShort.
type WizardStep ¶ added in v0.13.0
type WizardStep struct { Actions *[]ActionFull `json:"actions,omitempty"` Description *string `json:"description,omitempty"` Title *string `json:"title,omitempty"` }
WizardStep defines model for WizardStep.