Documentation ¶
Overview ¶
Package client provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func NewGetSpecRequest(server string) (*http.Request, error)
- func NewPostCompleteNameRequest(server string, name string, body PostCompleteNameJSONRequestBody) (*http.Request, error)
- func NewPostCompleteNameRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error)
- func NewPostInitRequest(server string, body PostInitJSONRequestBody) (*http.Request, error)
- func NewPostInitRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewPostStagesNameRequest(server string, name string, body PostStagesNameJSONRequestBody) (*http.Request, error)
- func NewPostStagesNameRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RegisterHandlers(router EchoRouter, si ServerInterface)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
- type Client
- func (c *Client) GetSpec(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) PostCompleteName(ctx context.Context, name string, body PostCompleteNameJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PostCompleteNameWithBody(ctx context.Context, name string, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) PostInit(ctx context.Context, body PostInitJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PostInitWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) PostStagesName(ctx context.Context, name string, body PostStagesNameJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PostStagesNameWithBody(ctx context.Context, name string, contentType string, body io.Reader, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) GetSpecWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSpecResponse, error)
- func (c *ClientWithResponses) PostCompleteNameWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, ...) (*PostCompleteNameResponse, error)
- func (c *ClientWithResponses) PostCompleteNameWithResponse(ctx context.Context, name string, body PostCompleteNameJSONRequestBody, ...) (*PostCompleteNameResponse, error)
- func (c *ClientWithResponses) PostInitWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*PostInitResponse, error)
- func (c *ClientWithResponses) PostInitWithResponse(ctx context.Context, body PostInitJSONRequestBody, ...) (*PostInitResponse, error)
- func (c *ClientWithResponses) PostStagesNameWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, ...) (*PostStagesNameResponse, error)
- func (c *ClientWithResponses) PostStagesNameWithResponse(ctx context.Context, name string, body PostStagesNameJSONRequestBody, ...) (*PostStagesNameResponse, error)
- type ClientWithResponsesInterface
- type CompleteStage
- type CompleteStageResponse
- type CompleteStageType
- type EchoRouter
- type Error
- type ErrorStage
- type GetSpecResponse
- type HttpRequestDoer
- type Input
- type Log
- type LogLevel
- type Output
- type OutputMimetype
- type PostCompleteNameJSONRequestBody
- type PostCompleteNameResponse
- type PostInitJSONBody
- type PostInitJSONRequestBody
- type PostInitResponse
- type PostStagesNameJSONRequestBody
- type PostStagesNameResponse
- type PreviousStageResult
- type RequestEditorFn
- type RetryStrategy
- type ServerInterface
- type ServerInterfaceWrapper
- type Spec
- type Stage
- type StageRequest
- type StageResponse
- type StageType
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 NewGetSpecRequest ¶
NewGetSpecRequest generates requests for GetSpec
func NewPostCompleteNameRequest ¶
func NewPostCompleteNameRequest(server string, name string, body PostCompleteNameJSONRequestBody) (*http.Request, error)
NewPostCompleteNameRequest calls the generic PostCompleteName builder with application/json body
func NewPostCompleteNameRequestWithBody ¶
func NewPostCompleteNameRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error)
NewPostCompleteNameRequestWithBody generates requests for PostCompleteName with any type of body
func NewPostInitRequest ¶
func NewPostInitRequest(server string, body PostInitJSONRequestBody) (*http.Request, error)
NewPostInitRequest calls the generic PostInit builder with application/json body
func NewPostInitRequestWithBody ¶
func NewPostInitRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewPostInitRequestWithBody generates requests for PostInit with any type of body
func NewPostStagesNameRequest ¶
func NewPostStagesNameRequest(server string, name string, body PostStagesNameJSONRequestBody) (*http.Request, error)
NewPostStagesNameRequest calls the generic PostStagesName builder with application/json body
func NewPostStagesNameRequestWithBody ¶
func NewPostStagesNameRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error)
NewPostStagesNameRequestWithBody generates requests for PostStagesName with any type of body
func PathToRawSpec ¶
Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
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)
Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.
Types ¶
type Client ¶
type Client struct { // The endpoint of the server conforming to this interface, with scheme, // https://api.deepmap.com for example. This can contain a path relative // to the server, such as https://api.deepmap.com/dev-test, and all the // paths in the swagger spec will be appended to the server. Server string // Doer for performing requests, typically a *http.Client with any // customized settings, such as certificate chains. Client HttpRequestDoer // A list of callbacks for modifying requests which are generated before sending over // the network. RequestEditors []RequestEditorFn }
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) PostCompleteName ¶
func (c *Client) PostCompleteName(ctx context.Context, name string, body PostCompleteNameJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) PostCompleteNameWithBody ¶
func (*Client) PostInit ¶
func (c *Client) PostInit(ctx context.Context, body PostInitJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) PostInitWithBody ¶
func (*Client) PostStagesName ¶
func (c *Client) PostStagesName(ctx context.Context, name string, body PostStagesNameJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
type ClientInterface ¶
type ClientInterface interface { // PostCompleteName request with any body PostCompleteNameWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) PostCompleteName(ctx context.Context, name string, body PostCompleteNameJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // PostInit request with any body PostInitWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) PostInit(ctx context.Context, body PostInitJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetSpec request GetSpec(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // PostStagesName request with any body PostStagesNameWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) PostStagesName(ctx context.Context, name string, body PostStagesNameJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) }
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) GetSpecWithResponse ¶
func (c *ClientWithResponses) GetSpecWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSpecResponse, error)
GetSpecWithResponse request returning *GetSpecResponse
func (*ClientWithResponses) PostCompleteNameWithBodyWithResponse ¶
func (c *ClientWithResponses) PostCompleteNameWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostCompleteNameResponse, error)
PostCompleteNameWithBodyWithResponse request with arbitrary body returning *PostCompleteNameResponse
func (*ClientWithResponses) PostCompleteNameWithResponse ¶
func (c *ClientWithResponses) PostCompleteNameWithResponse(ctx context.Context, name string, body PostCompleteNameJSONRequestBody, reqEditors ...RequestEditorFn) (*PostCompleteNameResponse, error)
func (*ClientWithResponses) PostInitWithBodyWithResponse ¶
func (c *ClientWithResponses) PostInitWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostInitResponse, error)
PostInitWithBodyWithResponse request with arbitrary body returning *PostInitResponse
func (*ClientWithResponses) PostInitWithResponse ¶
func (c *ClientWithResponses) PostInitWithResponse(ctx context.Context, body PostInitJSONRequestBody, reqEditors ...RequestEditorFn) (*PostInitResponse, error)
func (*ClientWithResponses) PostStagesNameWithBodyWithResponse ¶
func (c *ClientWithResponses) PostStagesNameWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostStagesNameResponse, error)
PostStagesNameWithBodyWithResponse request with arbitrary body returning *PostStagesNameResponse
func (*ClientWithResponses) PostStagesNameWithResponse ¶
func (c *ClientWithResponses) PostStagesNameWithResponse(ctx context.Context, name string, body PostStagesNameJSONRequestBody, reqEditors ...RequestEditorFn) (*PostStagesNameResponse, error)
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface { // PostCompleteName request with any body PostCompleteNameWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostCompleteNameResponse, error) PostCompleteNameWithResponse(ctx context.Context, name string, body PostCompleteNameJSONRequestBody, reqEditors ...RequestEditorFn) (*PostCompleteNameResponse, error) // PostInit request with any body PostInitWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostInitResponse, error) PostInitWithResponse(ctx context.Context, body PostInitJSONRequestBody, reqEditors ...RequestEditorFn) (*PostInitResponse, error) // GetSpec request GetSpecWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSpecResponse, error) // PostStagesName request with any body PostStagesNameWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostStagesNameResponse, error) PostStagesNameWithResponse(ctx context.Context, name string, body PostStagesNameJSONRequestBody, reqEditors ...RequestEditorFn) (*PostStagesNameResponse, error) }
ClientWithResponsesInterface is the interface specification for the client with responses above.
type CompleteStage ¶
type CompleteStage struct { Inputs []string `json:"inputs"` Name string `json:"name"` Type CompleteStageType `json:"type"` }
CompleteStage defines model for completeStage.
type CompleteStageResponse ¶
type CompleteStageResponse struct { Logs *[]Log `json:"logs,omitempty"` Outputs []Output `json:"outputs"` }
CompleteStageResponse defines model for completeStageResponse.
type CompleteStageType ¶
type CompleteStageType string
CompleteStageType defines model for CompleteStage.Type.
const (
Complete CompleteStageType = "complete"
)
Defines values for CompleteStageType.
type EchoRouter ¶
type EchoRouter interface { CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route }
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 ErrorStage ¶
type ErrorStage struct { Code string `json:"code"` Message string `json:"message"` Metadata *map[string]interface{} `json:"metadata,omitempty"` Retry *RetryStrategy `json:"retry,omitempty"` }
ErrorStage defines model for errorStage.
type GetSpecResponse ¶
type GetSpecResponse struct { Body []byte HTTPResponse *http.Response JSON200 *Spec JSON500 *Error }
func ParseGetSpecResponse ¶
func ParseGetSpecResponse(rsp *http.Response) (*GetSpecResponse, error)
ParseGetSpecResponse parses an HTTP response from a GetSpecWithResponse call
func (GetSpecResponse) Status ¶
func (r GetSpecResponse) Status() string
Status returns HTTPResponse.Status
func (GetSpecResponse) StatusCode ¶
func (r GetSpecResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type Input ¶
type Input struct { Name string `json:"name"` Value interface{} `json:"value"` }
Input defines model for input.
type Output ¶
type Output struct { Mimetype OutputMimetype `json:"mimetype"` Name string `json:"name"` // Value Any type of value Value interface{} `json:"value"` }
Output defines model for output.
type OutputMimetype ¶
type OutputMimetype string
OutputMimetype defines model for Output.Mimetype.
const ( Applicationjson OutputMimetype = "application/json" ApplicationoctetStream OutputMimetype = "application/octet-stream" Applicationtext OutputMimetype = "application/text" )
Defines values for OutputMimetype.
type PostCompleteNameJSONRequestBody ¶
type PostCompleteNameJSONRequestBody = StageRequest
PostCompleteNameJSONRequestBody defines body for PostCompleteName for application/json ContentType.
type PostCompleteNameResponse ¶
type PostCompleteNameResponse struct { Body []byte HTTPResponse *http.Response JSON200 *CompleteStageResponse JSON500 *ErrorStage }
func ParsePostCompleteNameResponse ¶
func ParsePostCompleteNameResponse(rsp *http.Response) (*PostCompleteNameResponse, error)
ParsePostCompleteNameResponse parses an HTTP response from a PostCompleteNameWithResponse call
func (PostCompleteNameResponse) Status ¶
func (r PostCompleteNameResponse) Status() string
Status returns HTTPResponse.Status
func (PostCompleteNameResponse) StatusCode ¶
func (r PostCompleteNameResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PostInitJSONBody ¶
type PostInitJSONBody struct { // Config Full user defined config to configure spark on initialise Config *string `json:"config,omitempty"` }
PostInitJSONBody defines parameters for PostInit.
type PostInitJSONRequestBody ¶
type PostInitJSONRequestBody PostInitJSONBody
PostInitJSONRequestBody defines body for PostInit for application/json ContentType.
type PostInitResponse ¶
func ParsePostInitResponse ¶
func ParsePostInitResponse(rsp *http.Response) (*PostInitResponse, error)
ParsePostInitResponse parses an HTTP response from a PostInitWithResponse call
func (PostInitResponse) Status ¶
func (r PostInitResponse) Status() string
Status returns HTTPResponse.Status
func (PostInitResponse) StatusCode ¶
func (r PostInitResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PostStagesNameJSONRequestBody ¶
type PostStagesNameJSONRequestBody = StageRequest
PostStagesNameJSONRequestBody defines body for PostStagesName for application/json ContentType.
type PostStagesNameResponse ¶
type PostStagesNameResponse struct { Body []byte HTTPResponse *http.Response JSON200 *StageResponse JSON500 *ErrorStage }
func ParsePostStagesNameResponse ¶
func ParsePostStagesNameResponse(rsp *http.Response) (*PostStagesNameResponse, error)
ParsePostStagesNameResponse parses an HTTP response from a PostStagesNameWithResponse call
func (PostStagesNameResponse) Status ¶
func (r PostStagesNameResponse) Status() string
Status returns HTTPResponse.Status
func (PostStagesNameResponse) StatusCode ¶
func (r PostStagesNameResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PreviousStageResult ¶
type PreviousStageResult struct { Name string `json:"name"` Value interface{} `json:"value"` }
PreviousStageResult defines model for previousStageResult.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type RetryStrategy ¶
type RetryStrategy struct { // BackoffMultiplier Backoff Multiplier to increment after each failure attempt BackoffMultiplier int `json:"backoffMultiplier"` // FirstBackoffWait First time to backoff wait in milliseconds FirstBackoffWait int `json:"firstBackoffWait"` Times int `json:"times"` }
RetryStrategy defines model for retryStrategy.
type ServerInterface ¶
type ServerInterface interface { // (POST /complete/{name}) PostCompleteName(ctx echo.Context, name string) error // (POST /init) PostInit(ctx echo.Context) error // (GET /spec) GetSpec(ctx echo.Context) error // (POST /stages/{name}) PostStagesName(ctx echo.Context, name string) error }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) GetSpec ¶
func (w *ServerInterfaceWrapper) GetSpec(ctx echo.Context) error
GetSpec converts echo context to params.
func (*ServerInterfaceWrapper) PostCompleteName ¶
func (w *ServerInterfaceWrapper) PostCompleteName(ctx echo.Context) error
PostCompleteName converts echo context to params.
func (*ServerInterfaceWrapper) PostInit ¶
func (w *ServerInterfaceWrapper) PostInit(ctx echo.Context) error
PostInit converts echo context to params.
func (*ServerInterfaceWrapper) PostStagesName ¶
func (w *ServerInterfaceWrapper) PostStagesName(ctx echo.Context) error
PostStagesName converts echo context to params.
type Spec ¶
type Spec struct { Complete CompleteStage `json:"complete"` Stages []Stage `json:"stages"` }
Spec defines model for spec.
type Stage ¶
type Stage struct { Inputs []string `json:"inputs"` Name string `json:"name"` Type StageType `json:"type"` }
Stage defines model for stage.
type StageRequest ¶
type StageRequest struct { CorrelationID string `json:"correlationID"` Inputs *[]Input `json:"inputs,omitempty"` JobKey string `json:"jobKey"` PreviousStages []PreviousStageResult `json:"previousStages"` TransactionID string `json:"transactionID"` }
StageRequest defines model for stageRequest.
type StageResponse ¶
type StageResponse struct { Logs *[]Log `json:"logs,omitempty"` Value interface{} `json:"value"` }
StageResponse defines model for stageResponse.