Documentation ¶
Overview ¶
Package api 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 GetLeafOutputs(ctx context.Context, dag []dag.Node[dag.IOSpec]) []string
- func GetSwagger() (swagger *openapi3.T, err error)
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r *mux.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r *mux.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options GorillaServerOptions) http.Handler
- func NewAmplifyAPI(er item.QueueRepository, tf task.TaskFactory) (*amplifyAPI, error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type Error
- type Errors
- type ExecutionRequest
- type GetV0QueueParams
- type GorillaServerOptions
- type Graph
- type Home
- type InvalidParamFormatError
- type Item
- type ItemMetadata
- type ItemResult
- type Job
- type Jobs
- type Links
- type MiddlewareFunc
- type Node
- type NodeConfig
- type NodeInput
- type NodeOutput
- type PageMeta
- type PostV0QueueFormdataRequestBody
- type PutV0QueueIdJSONRequestBody
- type Queue
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) GetV0(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetV0Graph(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetV0Jobs(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetV0JobsId(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetV0Queue(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetV0QueueId(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PostV0Queue(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PutV0QueueId(w http.ResponseWriter, r *http.Request)
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type UnmarshallingParamError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLeafOutputs ¶ added in v0.3.0
getLeafOutputs returns the outputs of the leaf nodes in the DAG
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 *mux.Router) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options GorillaServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
func NewAmplifyAPI ¶
func NewAmplifyAPI(er item.QueueRepository, tf task.TaskFactory) (*amplifyAPI, error)
Types ¶
type Error ¶
type Error struct { // Detail A human-readable explanation specific to this occurrence of the problem. Detail *string `json:"detail,omitempty"` // Title A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization. Title *string `json:"title,omitempty"` }
Error defines model for error.
type ExecutionRequest ¶
type ExecutionRequest struct {
Cid string `json:"cid"`
}
ExecutionRequest defines model for executionRequest.
type GetV0QueueParams ¶ added in v0.4.0
type GetV0QueueParams struct { // CreatedBefore Filter for items created before this date-time CreatedBefore *time.Time `form:"createdBefore,omitempty" json:"createdBefore,omitempty"` // CreatedAfter Filter for items created after this date-time CreatedAfter *time.Time `form:"createdAfter,omitempty" json:"createdAfter,omitempty"` // Limit The numbers of items to return Limit *int `form:"limit,omitempty" json:"limit,omitempty"` }
GetV0QueueParams defines parameters for GetV0Queue.
type GorillaServerOptions ¶
type GorillaServerOptions struct { BaseURL string BaseRouter *mux.Router Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type Graph ¶ added in v0.1.0
type Graph struct { Data *[]NodeConfig `json:"data,omitempty"` Links *Links `json:"links,omitempty"` }
Graph defines model for graph.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type Item ¶
type Item struct { Id string `json:"id"` Links *Links `json:"links,omitempty"` Metadata ItemMetadata `json:"metadata"` Type string `json:"type"` }
Item defines model for item.
type ItemMetadata ¶
type ItemMetadata struct { Ended *string `json:"ended,omitempty"` Started *string `json:"started,omitempty"` Status string `json:"status"` Submitted string `json:"submitted"` }
ItemMetadata defines model for itemMetadata.
type ItemResult ¶ added in v0.3.0
type ItemResult struct { // Id External execution ID Id *string `json:"id,omitempty"` // Skipped Whether this node was skipped due to predicates not matching. Skipped *bool `json:"skipped,omitempty"` Stderr *string `json:"stderr,omitempty"` Stdout *string `json:"stdout,omitempty"` }
ItemResult defines model for itemResult.
type Job ¶
type Job struct { Entrypoint *[]string `json:"entrypoint,omitempty"` Id string `json:"id"` Image string `json:"image"` Links *Links `json:"links,omitempty"` Type string `json:"type"` }
Job defines model for job.
type MiddlewareFunc ¶
type MiddlewareFunc func(http.HandlerFunc) http.HandlerFunc
type Node ¶
type Node struct { Children *[]Node `json:"children,omitempty"` Id openapi_types.UUID `json:"id"` Inputs []ExecutionRequest `json:"inputs"` Links *Links `json:"links,omitempty"` Metadata ItemMetadata `json:"metadata"` Name *string `json:"name,omitempty"` Outputs []ExecutionRequest `json:"outputs"` Result *ItemResult `json:"result,omitempty"` Type string `json:"type"` }
Node defines model for node.
type NodeConfig ¶
type NodeConfig struct { Id *string `json:"id,omitempty"` Inputs *[]NodeInput `json:"inputs,omitempty"` JobId *string `json:"job_id,omitempty"` Outputs *[]NodeOutput `json:"outputs,omitempty"` }
NodeConfig Static configuration of a node.
type NodeInput ¶
type NodeInput struct { OutputId *string `json:"output_id,omitempty"` Path *string `json:"path,omitempty"` Predicate *string `json:"predicate,omitempty"` Root *bool `json:"root,omitempty"` StepId *string `json:"step_id,omitempty"` }
NodeInput Input specification for a node.
type NodeOutput ¶
NodeOutput Output specification for a node.
type PageMeta ¶ added in v0.3.1
type PageMeta struct { // TotalPages Total number of pages in paginated result. TotalPages *int `json:"totalPages,omitempty"` }
PageMeta defines model for pageMeta.
type PostV0QueueFormdataRequestBody ¶ added in v0.4.0
type PostV0QueueFormdataRequestBody = ExecutionRequest
PostV0QueueFormdataRequestBody defines body for PostV0Queue for application/x-www-form-urlencoded ContentType.
type PutV0QueueIdJSONRequestBody ¶
type PutV0QueueIdJSONRequestBody = ExecutionRequest
PutV0QueueIdJSONRequestBody defines body for PutV0QueueId for application/json ContentType.
type Queue ¶
type Queue struct { Data *[]Item `json:"data,omitempty"` Links *Links `json:"links,omitempty"` Meta *PageMeta `json:"meta,omitempty"` }
Queue defines model for queue.
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 ServerInterface ¶
type ServerInterface interface { // Amplify V0 API Home // (GET /v0) GetV0(w http.ResponseWriter, r *http.Request) // Get Amplify work graph // (GET /v0/graph) GetV0Graph(w http.ResponseWriter, r *http.Request) // List all Amplify jobs // (GET /v0/jobs) GetV0Jobs(w http.ResponseWriter, r *http.Request) // Get a job by id // (GET /v0/jobs/{id}) GetV0JobsId(w http.ResponseWriter, r *http.Request, id string) // Amplify work queue // (GET /v0/queue) GetV0Queue(w http.ResponseWriter, r *http.Request, params GetV0QueueParams) // Run all workflows for a CID (not recommended) // (POST /v0/queue) PostV0Queue(w http.ResponseWriter, r *http.Request) // Get an item from the queue by id // (GET /v0/queue/{id}) GetV0QueueId(w http.ResponseWriter, r *http.Request, id openapi_types.UUID) // Run all workflows for a CID // (PUT /v0/queue/{id}) PutV0QueueId(w http.ResponseWriter, r *http.Request, id openapi_types.UUID) }
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) GetV0 ¶
func (siw *ServerInterfaceWrapper) GetV0(w http.ResponseWriter, r *http.Request)
GetV0 operation middleware
func (*ServerInterfaceWrapper) GetV0Graph ¶ added in v0.1.0
func (siw *ServerInterfaceWrapper) GetV0Graph(w http.ResponseWriter, r *http.Request)
GetV0Graph operation middleware
func (*ServerInterfaceWrapper) GetV0Jobs ¶
func (siw *ServerInterfaceWrapper) GetV0Jobs(w http.ResponseWriter, r *http.Request)
GetV0Jobs operation middleware
func (*ServerInterfaceWrapper) GetV0JobsId ¶
func (siw *ServerInterfaceWrapper) GetV0JobsId(w http.ResponseWriter, r *http.Request)
GetV0JobsId operation middleware
func (*ServerInterfaceWrapper) GetV0Queue ¶
func (siw *ServerInterfaceWrapper) GetV0Queue(w http.ResponseWriter, r *http.Request)
GetV0Queue operation middleware
func (*ServerInterfaceWrapper) GetV0QueueId ¶
func (siw *ServerInterfaceWrapper) GetV0QueueId(w http.ResponseWriter, r *http.Request)
GetV0QueueId operation middleware
func (*ServerInterfaceWrapper) PostV0Queue ¶ added in v0.4.0
func (siw *ServerInterfaceWrapper) PostV0Queue(w http.ResponseWriter, r *http.Request)
PostV0Queue operation middleware
func (*ServerInterfaceWrapper) PutV0QueueId ¶
func (siw *ServerInterfaceWrapper) PutV0QueueId(w http.ResponseWriter, r *http.Request)
PutV0QueueId 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 UnmarshallingParamError ¶
func (*UnmarshallingParamError) Error ¶
func (e *UnmarshallingParamError) Error() string
func (*UnmarshallingParamError) Unwrap ¶
func (e *UnmarshallingParamError) Unwrap() error