oapi

package
v0.0.0-...-b66bdfa Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package oapi provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.16.2 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 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

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

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

Types

type ChiServerOptions

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

type History

type History struct {
	HistoryID *int                `json:"historyID,omitempty"`
	IsrJobID  *openapi_types.UUID `json:"isrJobID,omitempty"`
	Status    *string             `json:"status,omitempty"`
	Timestamp *string             `json:"timestamp,omitempty"`
}

History defines model for History.

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 ListHistoriesParams

type ListHistoriesParams struct {
	// Limit Maximum number to retrieve at once
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset Offset when retrieving
	Offset *int `form:"offset,omitempty" json:"offset,omitempty"`

	// Latest Get only latest histories
	Latest *bool `form:"latest,omitempty" json:"latest,omitempty"`
}

ListHistoriesParams defines parameters for ListHistories.

type ListHistoriesResponse

type ListHistoriesResponse struct {
	HasNext   *bool      `json:"hasNext,omitempty"`
	Histories *[]History `json:"histories,omitempty"`
}

ListHistoriesResponse defines model for ListHistoriesResponse.

type Message

type Message struct {
	Message *string `json:"message,omitempty"`
}

Message defines model for Message.

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

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 {

	// (GET /health)
	HealthCheck(w http.ResponseWriter, r *http.Request)

	// (GET /histories)
	ListHistories(w http.ResponseWriter, r *http.Request, params ListHistoriesParams)

	// (POST /images/upload)
	UploadImage(w http.ResponseWriter, r *http.Request)

	// (GET /images/{jobID})
	DownloadImage(w http.ResponseWriter, r *http.Request, jobID 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) DownloadImage

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

DownloadImage operation middleware

func (*ServerInterfaceWrapper) HealthCheck

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

HealthCheck operation middleware

func (*ServerInterfaceWrapper) ListHistories

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

ListHistories operation middleware

func (*ServerInterfaceWrapper) UploadImage

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

UploadImage 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 Unimplemented

type Unimplemented struct{}

func (Unimplemented) DownloadImage

func (_ Unimplemented) DownloadImage(w http.ResponseWriter, r *http.Request, jobID openapi_types.UUID)

(GET /images/{jobID})

func (Unimplemented) HealthCheck

func (_ Unimplemented) HealthCheck(w http.ResponseWriter, r *http.Request)

(GET /health)

func (Unimplemented) ListHistories

func (_ Unimplemented) ListHistories(w http.ResponseWriter, r *http.Request, params ListHistoriesParams)

(GET /histories)

func (Unimplemented) UploadImage

func (_ Unimplemented) UploadImage(w http.ResponseWriter, r *http.Request)

(POST /images/upload)

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

type UploadImageMultipartBody

type UploadImageMultipartBody struct {
	File *openapi_types.File `json:"file,omitempty"`
}

UploadImageMultipartBody defines parameters for UploadImage.

type UploadImageMultipartRequestBody

type UploadImageMultipartRequestBody UploadImageMultipartBody

UploadImageMultipartRequestBody defines body for UploadImage for multipart/form-data ContentType.

Jump to

Keyboard shortcuts

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