api

package
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

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 HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r *mux.Router, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options GorillaServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

func NewAmplifyAPI

func NewAmplifyAPI(er queue.QueueRepository, tf *task.TaskFactory) *amplifyAPI

TODO: Getting gross

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

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 Errors

type Errors = []Error

Errors defines model for errors.

type ExecutionInfo

type ExecutionInfo struct {
	// Id External execution ID
	Id *string `json:"id,omitempty"`

	// Status External status of the job
	Status *string `json:"status,omitempty"`
	Stderr *string `json:"stderr,omitempty"`
	Stdout *string `json:"stdout,omitempty"`
}

ExecutionInfo defines model for executionInfo.

type ExecutionRequest

type ExecutionRequest struct {
	Cid string `json:"cid"`
}

ExecutionRequest defines model for executionRequest.

type GorillaServerOptions

type GorillaServerOptions struct {
	BaseURL          string
	BaseRouter       *mux.Router
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type Home

type Home struct {
	Links *Links  `json:"links,omitempty"`
	Type  *string `json:"type,omitempty"`
}

Home defines model for home.

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

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"`
	Submitted string  `json:"submitted"`
}

ItemMetadata defines model for itemMetadata.

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 Jobs

type Jobs struct {
	Data  *[]Job `json:"data,omitempty"`
	Links *Links `json:"links,omitempty"`
}

Jobs defines model for jobs.

type Links = map[string]interface{}

Links defines model for links.

type MiddlewareFunc

type MiddlewareFunc func(http.HandlerFunc) http.HandlerFunc

type Node

type Node struct {
	Children  *[]Node            `json:"children,omitempty"`
	Execution *ExecutionInfo     `json:"execution,omitempty"`
	Id        openapi_types.UUID `json:"id"`
	Inputs    []ExecutionRequest `json:"inputs"`
	Links     *Links             `json:"links,omitempty"`
	Metadata  ItemMetadata       `json:"metadata"`
	Outputs   []ExecutionRequest `json:"outputs"`
	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"`
	Root     *bool   `json:"root,omitempty"`
	StepId   *string `json:"step_id,omitempty"`
}

NodeInput Input specification for a node.

type NodeOutput

type NodeOutput struct {
	Id   *string `json:"id,omitempty"`
	Path *string `json:"path,omitempty"`
}

NodeOutput Output specification for a node.

type Nodes

type Nodes struct {
	Data  *[]NodeConfig `json:"data,omitempty"`
	Links *Links        `json:"links,omitempty"`
}

Nodes defines model for nodes.

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"`
}

Queue defines model for queue.

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

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 home
	// (GET /v0)
	GetV0(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)
	// List all Amplify nodes
	// (GET /v0/nodes)
	GetV0Nodes(w http.ResponseWriter, r *http.Request)
	// Amplify work queue
	// (GET /v0/queue)
	GetV0Queue(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

GetV0 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) GetV0Nodes

func (siw *ServerInterfaceWrapper) GetV0Nodes(w http.ResponseWriter, r *http.Request)

GetV0Nodes 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) PutV0QueueId

func (siw *ServerInterfaceWrapper) PutV0QueueId(w http.ResponseWriter, r *http.Request)

PutV0QueueId operation middleware

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type UnmarshallingParamError

type UnmarshallingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshallingParamError) Error

func (e *UnmarshallingParamError) Error() string

func (*UnmarshallingParamError) Unwrap

func (e *UnmarshallingParamError) Unwrap() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL