Documentation ¶
Overview ¶
Package restapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.11.1-0.20220609223533-7da811e1cf30 DO NOT EDIT.
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)
- type APIDiffs
- type ChiServerOptions
- type Diff
- type InvalidParamFormatError
- type MiddlewareFunc
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- type SpecDiffs
- type SpecDiffsNotification
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- 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
Types ¶
type APIDiffs ¶
type APIDiffs struct { ApiInfo externalRef0.ApiInfo `json:"apiInfo"` Diffs []Diff `json:"diffs"` }
APIDiffs defines model for APIDiffs.
type ChiServerOptions ¶
type ChiServerOptions struct { BaseURL string BaseRouter chi.Router Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type Diff ¶
type Diff struct { DiffType externalRef0.DiffType `json:"diffType"` // Timestamp of the time that the diff was last seen LastSeen int64 `json:"lastSeen"` Method *externalRef0.HttpMethod `json:"method,omitempty"` // New spec json string NewSpec string `json:"newSpec"` // Old spec json string OldSpec string `json:"oldSpec"` // Path of the diff element Path *string `json:"path,omitempty"` SpecType *externalRef0.SpecType `json:"specType,omitempty"` }
Diff defines model for Diff.
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 ServerInterface ¶
type ServerInterface interface { // Start Differ for an API // (POST /{apiID}/start) StartDiffer(w http.ResponseWriter, r *http.Request, apiID externalRef0.ApiID) // Stop Differ for an API // (POST /{apiID}/stop) StopDiffer(w http.ResponseWriter, r *http.Request, apiID externalRef0.ApiID) }
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) StartDiffer ¶
func (siw *ServerInterfaceWrapper) StartDiffer(w http.ResponseWriter, r *http.Request)
StartDiffer operation middleware
func (*ServerInterfaceWrapper) StopDiffer ¶
func (siw *ServerInterfaceWrapper) StopDiffer(w http.ResponseWriter, r *http.Request)
StopDiffer operation middleware
type SpecDiffs ¶
type SpecDiffs struct {
Diffs APIDiffs `json:"diffs"`
}
SpecDiffs defines model for SpecDiffs.
type SpecDiffsNotification ¶
type SpecDiffsNotification struct { Diffs APIDiffs `json:"diffs"` NotificationType string `json:"notificationType"` }
SpecDiffsNotification defines model for SpecDiffsNotification.
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 UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error