Documentation
¶
Overview ¶
Package server provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 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 ActionRunStreamData
- type ActionRunStreamDataType
- type ActionShort
- type ChiServerOptions
- 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) 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) 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) 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) RunAction(w http.ResponseWriter, r *http.Request, id ActionId)
- type UnmarshalingParamError
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.Schema `json:"jsonschema"` Title string `json:"title"` }
ActionFull defines model for ActionFull.
type ActionRunInfo ¶
ActionRunInfo defines model for ActionRunInfo.
type ActionRunInfoId ¶
type ActionRunInfoId = string
ActionRunInfoId defines model for ActionRunInfoId.
type ActionRunParams ¶
type ActionRunParams struct { Arguments action.TypeArgs `json:"arguments"` Options action.TypeOpts `json:"options"` }
ActionRunParams defines model for ActionRunParams.
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 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.
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) }
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) 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) 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) 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) 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