gatewayapi

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

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

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 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, m ServeMux) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) 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 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 JSONRequest

type JSONRequest struct {
	// contains filtered or unexported fields
}

JSONRequest Proxy request to a backend.

func (JSONRequest) AsJSONRequest0

func (t JSONRequest) AsJSONRequest0() (JSONRequest0, error)

AsJSONRequest0 returns the union data inside the JSONRequest as a JSONRequest0

func (JSONRequest) AsJSONRequest1

func (t JSONRequest) AsJSONRequest1() (JSONRequest1, error)

AsJSONRequest1 returns the union data inside the JSONRequest as a JSONRequest1

func (*JSONRequest) FromJSONRequest0

func (t *JSONRequest) FromJSONRequest0(v JSONRequest0) error

FromJSONRequest0 overwrites any union data inside the JSONRequest as the provided JSONRequest0

func (*JSONRequest) FromJSONRequest1

func (t *JSONRequest) FromJSONRequest1(v JSONRequest1) error

FromJSONRequest1 overwrites any union data inside the JSONRequest as the provided JSONRequest1

func (JSONRequest) MarshalJSON

func (t JSONRequest) MarshalJSON() ([]byte, error)

func (*JSONRequest) MergeJSONRequest0

func (t *JSONRequest) MergeJSONRequest0(v JSONRequest0) error

MergeJSONRequest0 performs a merge with any union data inside the JSONRequest, using the provided JSONRequest0

func (*JSONRequest) MergeJSONRequest1

func (t *JSONRequest) MergeJSONRequest1(v JSONRequest1) error

MergeJSONRequest1 performs a merge with any union data inside the JSONRequest, using the provided JSONRequest1

func (*JSONRequest) UnmarshalJSON

func (t *JSONRequest) UnmarshalJSON(b []byte) error

type JSONRequest0

type JSONRequest0 = map[string]interface{}

JSONRequest0 defines model for .

type JSONRequest1

type JSONRequest1 = []interface{}

JSONRequest1 defines model for .

type JSONResponse

type JSONResponse struct {
	// contains filtered or unexported fields
}

JSONResponse Proxy response from a backend.

func (JSONResponse) AsJSONResponse0

func (t JSONResponse) AsJSONResponse0() (JSONResponse0, error)

AsJSONResponse0 returns the union data inside the JSONResponse as a JSONResponse0

func (JSONResponse) AsJSONResponse1

func (t JSONResponse) AsJSONResponse1() (JSONResponse1, error)

AsJSONResponse1 returns the union data inside the JSONResponse as a JSONResponse1

func (*JSONResponse) FromJSONResponse0

func (t *JSONResponse) FromJSONResponse0(v JSONResponse0) error

FromJSONResponse0 overwrites any union data inside the JSONResponse as the provided JSONResponse0

func (*JSONResponse) FromJSONResponse1

func (t *JSONResponse) FromJSONResponse1(v JSONResponse1) error

FromJSONResponse1 overwrites any union data inside the JSONResponse as the provided JSONResponse1

func (JSONResponse) MarshalJSON

func (t JSONResponse) MarshalJSON() ([]byte, error)

func (*JSONResponse) MergeJSONResponse0

func (t *JSONResponse) MergeJSONResponse0(v JSONResponse0) error

MergeJSONResponse0 performs a merge with any union data inside the JSONResponse, using the provided JSONResponse0

func (*JSONResponse) MergeJSONResponse1

func (t *JSONResponse) MergeJSONResponse1(v JSONResponse1) error

MergeJSONResponse1 performs a merge with any union data inside the JSONResponse, using the provided JSONResponse1

func (*JSONResponse) UnmarshalJSON

func (t *JSONResponse) UnmarshalJSON(b []byte) error

type JSONResponse0

type JSONResponse0 = map[string]interface{}

JSONResponse0 defines model for .

type JSONResponse1

type JSONResponse1 = []interface{}

JSONResponse1 defines model for .

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type ProxyDeleteJSONRequestBody

type ProxyDeleteJSONRequestBody = JSONRequest

ProxyDeleteJSONRequestBody defines body for ProxyDelete for application/json ContentType.

type ProxyDeleteRequestObject

type ProxyDeleteRequestObject struct {
	Backend     string `json:"backend"`
	ContentType string
	JSONBody    *ProxyDeleteJSONRequestBody
	Body        io.Reader
}

type ProxyDeleteResponseObject

type ProxyDeleteResponseObject interface {
	VisitProxyDeleteResponse(w http.ResponseWriter) error
}

type ProxyDeletedefaultJSONResponse

type ProxyDeletedefaultJSONResponse struct {
	Body       JSONResponse
	StatusCode int
}

func (ProxyDeletedefaultJSONResponse) VisitProxyDeleteResponse

func (response ProxyDeletedefaultJSONResponse) VisitProxyDeleteResponse(w http.ResponseWriter) error

type ProxyDeletedefaultTextResponse

type ProxyDeletedefaultTextResponse struct {
	Body          io.Reader
	StatusCode    int
	ContentType   string
	ContentLength int64
}

func (ProxyDeletedefaultTextResponse) VisitProxyDeleteResponse

func (response ProxyDeletedefaultTextResponse) VisitProxyDeleteResponse(w http.ResponseWriter) error

type ProxyGetJSONRequestBody

type ProxyGetJSONRequestBody = JSONRequest

ProxyGetJSONRequestBody defines body for ProxyGet for application/json ContentType.

type ProxyGetRequestObject

type ProxyGetRequestObject struct {
	Backend     string `json:"backend"`
	ContentType string
	JSONBody    *ProxyGetJSONRequestBody
	Body        io.Reader
}

type ProxyGetResponseObject

type ProxyGetResponseObject interface {
	VisitProxyGetResponse(w http.ResponseWriter) error
}

type ProxyGetdefaultJSONResponse

type ProxyGetdefaultJSONResponse struct {
	Body       JSONResponse
	StatusCode int
}

func (ProxyGetdefaultJSONResponse) VisitProxyGetResponse

func (response ProxyGetdefaultJSONResponse) VisitProxyGetResponse(w http.ResponseWriter) error

type ProxyGetdefaultTextResponse

type ProxyGetdefaultTextResponse struct {
	Body          io.Reader
	StatusCode    int
	ContentType   string
	ContentLength int64
}

func (ProxyGetdefaultTextResponse) VisitProxyGetResponse

func (response ProxyGetdefaultTextResponse) VisitProxyGetResponse(w http.ResponseWriter) error

type ProxyHeadJSONRequestBody

type ProxyHeadJSONRequestBody = JSONRequest

ProxyHeadJSONRequestBody defines body for ProxyHead for application/json ContentType.

type ProxyHeadRequestObject

type ProxyHeadRequestObject struct {
	Backend     string `json:"backend"`
	ContentType string
	JSONBody    *ProxyHeadJSONRequestBody
	Body        io.Reader
}

type ProxyHeadResponseObject

type ProxyHeadResponseObject interface {
	VisitProxyHeadResponse(w http.ResponseWriter) error
}

type ProxyHeaddefaultJSONResponse

type ProxyHeaddefaultJSONResponse struct {
	Body       JSONResponse
	StatusCode int
}

func (ProxyHeaddefaultJSONResponse) VisitProxyHeadResponse

func (response ProxyHeaddefaultJSONResponse) VisitProxyHeadResponse(w http.ResponseWriter) error

type ProxyHeaddefaultTextResponse

type ProxyHeaddefaultTextResponse struct {
	Body          io.Reader
	StatusCode    int
	ContentType   string
	ContentLength int64
}

func (ProxyHeaddefaultTextResponse) VisitProxyHeadResponse

func (response ProxyHeaddefaultTextResponse) VisitProxyHeadResponse(w http.ResponseWriter) error

type ProxyOptionsJSONRequestBody

type ProxyOptionsJSONRequestBody = JSONRequest

ProxyOptionsJSONRequestBody defines body for ProxyOptions for application/json ContentType.

type ProxyOptionsRequestObject

type ProxyOptionsRequestObject struct {
	Backend     string `json:"backend"`
	ContentType string
	JSONBody    *ProxyOptionsJSONRequestBody
	Body        io.Reader
}

type ProxyOptionsResponseObject

type ProxyOptionsResponseObject interface {
	VisitProxyOptionsResponse(w http.ResponseWriter) error
}

type ProxyOptionsdefaultJSONResponse

type ProxyOptionsdefaultJSONResponse struct {
	Body       JSONResponse
	StatusCode int
}

func (ProxyOptionsdefaultJSONResponse) VisitProxyOptionsResponse

func (response ProxyOptionsdefaultJSONResponse) VisitProxyOptionsResponse(w http.ResponseWriter) error

type ProxyOptionsdefaultTextResponse

type ProxyOptionsdefaultTextResponse struct {
	Body          io.Reader
	StatusCode    int
	ContentType   string
	ContentLength int64
}

func (ProxyOptionsdefaultTextResponse) VisitProxyOptionsResponse

func (response ProxyOptionsdefaultTextResponse) VisitProxyOptionsResponse(w http.ResponseWriter) error

type ProxyPatchJSONRequestBody

type ProxyPatchJSONRequestBody = JSONRequest

ProxyPatchJSONRequestBody defines body for ProxyPatch for application/json ContentType.

type ProxyPatchRequestObject

type ProxyPatchRequestObject struct {
	Backend     string `json:"backend"`
	ContentType string
	JSONBody    *ProxyPatchJSONRequestBody
	Body        io.Reader
}

type ProxyPatchResponseObject

type ProxyPatchResponseObject interface {
	VisitProxyPatchResponse(w http.ResponseWriter) error
}

type ProxyPatchdefaultJSONResponse

type ProxyPatchdefaultJSONResponse struct {
	Body       JSONResponse
	StatusCode int
}

func (ProxyPatchdefaultJSONResponse) VisitProxyPatchResponse

func (response ProxyPatchdefaultJSONResponse) VisitProxyPatchResponse(w http.ResponseWriter) error

type ProxyPatchdefaultTextResponse

type ProxyPatchdefaultTextResponse struct {
	Body          io.Reader
	StatusCode    int
	ContentType   string
	ContentLength int64
}

func (ProxyPatchdefaultTextResponse) VisitProxyPatchResponse

func (response ProxyPatchdefaultTextResponse) VisitProxyPatchResponse(w http.ResponseWriter) error

type ProxyPostJSONRequestBody

type ProxyPostJSONRequestBody = JSONRequest

ProxyPostJSONRequestBody defines body for ProxyPost for application/json ContentType.

type ProxyPostRequestObject

type ProxyPostRequestObject struct {
	Backend     string `json:"backend"`
	ContentType string
	JSONBody    *ProxyPostJSONRequestBody
	Body        io.Reader
}

type ProxyPostResponseObject

type ProxyPostResponseObject interface {
	VisitProxyPostResponse(w http.ResponseWriter) error
}

type ProxyPostdefaultJSONResponse

type ProxyPostdefaultJSONResponse struct {
	Body       JSONResponse
	StatusCode int
}

func (ProxyPostdefaultJSONResponse) VisitProxyPostResponse

func (response ProxyPostdefaultJSONResponse) VisitProxyPostResponse(w http.ResponseWriter) error

type ProxyPostdefaultTextResponse

type ProxyPostdefaultTextResponse struct {
	Body          io.Reader
	StatusCode    int
	ContentType   string
	ContentLength int64
}

func (ProxyPostdefaultTextResponse) VisitProxyPostResponse

func (response ProxyPostdefaultTextResponse) VisitProxyPostResponse(w http.ResponseWriter) error

type ProxyPutJSONRequestBody

type ProxyPutJSONRequestBody = JSONRequest

ProxyPutJSONRequestBody defines body for ProxyPut for application/json ContentType.

type ProxyPutRequestObject

type ProxyPutRequestObject struct {
	Backend     string `json:"backend"`
	ContentType string
	JSONBody    *ProxyPutJSONRequestBody
	Body        io.Reader
}

type ProxyPutResponseObject

type ProxyPutResponseObject interface {
	VisitProxyPutResponse(w http.ResponseWriter) error
}

type ProxyPutdefaultJSONResponse

type ProxyPutdefaultJSONResponse struct {
	Body       JSONResponse
	StatusCode int
}

func (ProxyPutdefaultJSONResponse) VisitProxyPutResponse

func (response ProxyPutdefaultJSONResponse) VisitProxyPutResponse(w http.ResponseWriter) error

type ProxyPutdefaultTextResponse

type ProxyPutdefaultTextResponse struct {
	Body          io.Reader
	StatusCode    int
	ContentType   string
	ContentLength int64
}

func (ProxyPutdefaultTextResponse) VisitProxyPutResponse

func (response ProxyPutdefaultTextResponse) VisitProxyPutResponse(w http.ResponseWriter) error

type ProxyRequest

type ProxyRequest = JSONRequest

ProxyRequest Proxy request to a backend.

type ProxyResponse

type ProxyResponse = JSONResponse

ProxyResponse Proxy response from a backend.

type ProxyResponseJSONResponse

type ProxyResponseJSONResponse JSONResponse

type ProxyResponseTextResponse

type ProxyResponseTextResponse struct {
	Body io.Reader

	ContentType   string
	ContentLength int64
}

type ProxyTraceJSONRequestBody

type ProxyTraceJSONRequestBody = JSONRequest

ProxyTraceJSONRequestBody defines body for ProxyTrace for application/json ContentType.

type ProxyTraceRequestObject

type ProxyTraceRequestObject struct {
	Backend     string `json:"backend"`
	ContentType string
	JSONBody    *ProxyTraceJSONRequestBody
	Body        io.Reader
}

type ProxyTraceResponseObject

type ProxyTraceResponseObject interface {
	VisitProxyTraceResponse(w http.ResponseWriter) error
}

type ProxyTracedefaultJSONResponse

type ProxyTracedefaultJSONResponse struct {
	Body       JSONResponse
	StatusCode int
}

func (ProxyTracedefaultJSONResponse) VisitProxyTraceResponse

func (response ProxyTracedefaultJSONResponse) VisitProxyTraceResponse(w http.ResponseWriter) error

type ProxyTracedefaultTextResponse

type ProxyTracedefaultTextResponse struct {
	Body          io.Reader
	StatusCode    int
	ContentType   string
	ContentLength int64
}

func (ProxyTracedefaultTextResponse) VisitProxyTraceResponse

func (response ProxyTracedefaultTextResponse) VisitProxyTraceResponse(w http.ResponseWriter) error

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 ServeMux

type ServeMux interface {
	HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
	ServeHTTP(w http.ResponseWriter, r *http.Request)
}

ServeMux is an abstraction of http.ServeMux.

type ServerInterface

type ServerInterface interface {

	// (DELETE /gw/backend/{backend}/*)
	ProxyDelete(w http.ResponseWriter, r *http.Request, backend string)

	// (GET /gw/backend/{backend}/*)
	ProxyGet(w http.ResponseWriter, r *http.Request, backend string)

	// (HEAD /gw/backend/{backend}/*)
	ProxyHead(w http.ResponseWriter, r *http.Request, backend string)

	// (OPTIONS /gw/backend/{backend}/*)
	ProxyOptions(w http.ResponseWriter, r *http.Request, backend string)

	// (PATCH /gw/backend/{backend}/*)
	ProxyPatch(w http.ResponseWriter, r *http.Request, backend string)

	// (POST /gw/backend/{backend}/*)
	ProxyPost(w http.ResponseWriter, r *http.Request, backend string)

	// (PUT /gw/backend/{backend}/*)
	ProxyPut(w http.ResponseWriter, r *http.Request, backend string)

	// (TRACE /gw/backend/{backend}/*)
	ProxyTrace(w http.ResponseWriter, r *http.Request, backend string)
}

ServerInterface represents all server handlers.

func NewStrictHandler

func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface

func NewStrictHandlerWithOptions

func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface

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) ProxyDelete

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

ProxyDelete operation middleware

func (*ServerInterfaceWrapper) ProxyGet

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

ProxyGet operation middleware

func (*ServerInterfaceWrapper) ProxyHead

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

ProxyHead operation middleware

func (*ServerInterfaceWrapper) ProxyOptions

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

ProxyOptions operation middleware

func (*ServerInterfaceWrapper) ProxyPatch

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

ProxyPatch operation middleware

func (*ServerInterfaceWrapper) ProxyPost

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

ProxyPost operation middleware

func (*ServerInterfaceWrapper) ProxyPut

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

ProxyPut operation middleware

func (*ServerInterfaceWrapper) ProxyTrace

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

ProxyTrace operation middleware

type StdHTTPServerOptions

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

type StrictHTTPServerOptions

type StrictHTTPServerOptions struct {
	RequestErrorHandlerFunc  func(w http.ResponseWriter, r *http.Request, err error)
	ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type StrictServerInterface

type StrictServerInterface interface {

	// (DELETE /gw/backend/{backend}/*)
	ProxyDelete(ctx context.Context, request ProxyDeleteRequestObject) (ProxyDeleteResponseObject, error)

	// (GET /gw/backend/{backend}/*)
	ProxyGet(ctx context.Context, request ProxyGetRequestObject) (ProxyGetResponseObject, error)

	// (HEAD /gw/backend/{backend}/*)
	ProxyHead(ctx context.Context, request ProxyHeadRequestObject) (ProxyHeadResponseObject, error)

	// (OPTIONS /gw/backend/{backend}/*)
	ProxyOptions(ctx context.Context, request ProxyOptionsRequestObject) (ProxyOptionsResponseObject, error)

	// (PATCH /gw/backend/{backend}/*)
	ProxyPatch(ctx context.Context, request ProxyPatchRequestObject) (ProxyPatchResponseObject, error)

	// (POST /gw/backend/{backend}/*)
	ProxyPost(ctx context.Context, request ProxyPostRequestObject) (ProxyPostResponseObject, error)

	// (PUT /gw/backend/{backend}/*)
	ProxyPut(ctx context.Context, request ProxyPutRequestObject) (ProxyPutResponseObject, error)

	// (TRACE /gw/backend/{backend}/*)
	ProxyTrace(ctx context.Context, request ProxyTraceRequestObject) (ProxyTraceResponseObject, error)
}

StrictServerInterface represents all server handlers.

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 UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

Jump to

Keyboard shortcuts

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