openapi

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

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

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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

Types

type Auth302Response

type Auth302Response struct {
	Headers Auth302ResponseHeaders
}

func (Auth302Response) VisitAuthResponse

func (response Auth302Response) VisitAuthResponse(w http.ResponseWriter) error

type Auth302ResponseHeaders

type Auth302ResponseHeaders struct {
	Location string
}

type AuthParams

type AuthParams struct {
	TenantID   string `form:"tenant_id" json:"tenant_id"`
	RequestURI string `form:"request_uri" json:"request_uri"`
}

AuthParams defines parameters for Auth.

type AuthRequestObject

type AuthRequestObject struct {
	Params AuthParams
}

type AuthResponseObject

type AuthResponseObject interface {
	VisitAuthResponse(w http.ResponseWriter) error
}

type AuthdefaultJSONResponse

type AuthdefaultJSONResponse struct {
	Body       ErrorModel
	StatusCode int
}

func (AuthdefaultJSONResponse) VisitAuthResponse

func (response AuthdefaultJSONResponse) VisitAuthResponse(w http.ResponseWriter) error

type Callback302Response added in v0.1.0

type Callback302Response struct {
	Headers Callback302ResponseHeaders
}

func (Callback302Response) VisitCallbackResponse added in v0.1.0

func (response Callback302Response) VisitCallbackResponse(w http.ResponseWriter) error

type Callback302ResponseHeaders added in v0.1.0

type Callback302ResponseHeaders struct {
	Location  string
	SetCookie []string
}

type Callback403JSONResponse added in v0.1.0

type Callback403JSONResponse ErrorModel

func (Callback403JSONResponse) VisitCallbackResponse added in v0.1.0

func (response Callback403JSONResponse) VisitCallbackResponse(w http.ResponseWriter) error

type CallbackParams added in v0.1.0

type CallbackParams struct {
	Code  string `form:"code" json:"code"`
	State string `form:"state" json:"state"`
}

CallbackParams defines parameters for Callback.

type CallbackRequestObject added in v0.1.0

type CallbackRequestObject struct {
	Params CallbackParams
}

type CallbackResponseObject added in v0.1.0

type CallbackResponseObject interface {
	VisitCallbackResponse(w http.ResponseWriter) error
}

type CallbackdefaultJSONResponse added in v0.1.0

type CallbackdefaultJSONResponse struct {
	Body       ErrorModel
	StatusCode int
}

func (CallbackdefaultJSONResponse) VisitCallbackResponse added in v0.1.0

func (response CallbackdefaultJSONResponse) VisitCallbackResponse(w http.ResponseWriter) error

type ErrorModel

type ErrorModel struct {
	ErrorCode *int    `json:"error_code,omitempty"`
	ErrorMsg  *string `json:"error_msg,omitempty"`
}

ErrorModel defines model for ErrorModel.

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 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 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 {

	// (GET /auth)
	Auth(w http.ResponseWriter, r *http.Request, params AuthParams)

	// (GET /callback)
	Callback(w http.ResponseWriter, r *http.Request, params CallbackParams)
}

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

Auth operation middleware

func (*ServerInterfaceWrapper) Callback added in v0.1.0

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

Callback 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 {

	// (GET /auth)
	Auth(ctx context.Context, request AuthRequestObject) (AuthResponseObject, error)

	// (GET /callback)
	Callback(ctx context.Context, request CallbackRequestObject) (CallbackResponseObject, 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