v1

package
v0.0.0-...-f7a2d95 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package v1 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 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 ErrorResponse

type ErrorResponse struct {
	Error   string `json:"error"`
	Message string `json:"message"`
}

ErrorResponse defines model for ErrorResponse.

type GenerateSubdomain200JSONResponse

type GenerateSubdomain200JSONResponse NewSubdomainResponse

func (GenerateSubdomain200JSONResponse) VisitGenerateSubdomainResponse

func (response GenerateSubdomain200JSONResponse) VisitGenerateSubdomainResponse(w http.ResponseWriter) error

type GenerateSubdomain429JSONResponse

type GenerateSubdomain429JSONResponse ErrorResponse

func (GenerateSubdomain429JSONResponse) VisitGenerateSubdomainResponse

func (response GenerateSubdomain429JSONResponse) VisitGenerateSubdomainResponse(w http.ResponseWriter) error

type GenerateSubdomainRequestObject

type GenerateSubdomainRequestObject struct {
}

type GenerateSubdomainResponseObject

type GenerateSubdomainResponseObject interface {
	VisitGenerateSubdomainResponse(w http.ResponseWriter) error
}

type GetOverview200JSONResponse

type GetOverview200JSONResponse OverviewResponse

func (GetOverview200JSONResponse) VisitGetOverviewResponse

func (response GetOverview200JSONResponse) VisitGetOverviewResponse(w http.ResponseWriter) error

type GetOverviewRequestObject

type GetOverviewRequestObject struct {
}

type GetOverviewResponseObject

type GetOverviewResponseObject interface {
	VisitGetOverviewResponse(w http.ResponseWriter) error
}

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 NewSubdomainResponse

type NewSubdomainResponse struct {
	// Domain Allocated domain.
	Domain string `json:"domain"`

	// Id Subdomain ID.
	Id openapi_types.UUID `json:"id"`

	// Token Control Token.
	Token string `json:"token"`
}

NewSubdomainResponse New Subdomain Response.

type OverviewResponse

type OverviewResponse struct {
	// ClientIp The clients IP address.
	ClientIp string `json:"client_ip"`

	// Version Server Version.
	Version string `json:"version"`
}

OverviewResponse defines model for OverviewResponse.

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 {
	// Server Overview
	// (GET /)
	GetOverview(w http.ResponseWriter, r *http.Request)
	// Request new subdomain
	// (POST /subdomain)
	GenerateSubdomain(w http.ResponseWriter, r *http.Request)
	// Set ACME challenge tokens
	// (POST /subdomain/{subdomainId}/acme-challenge)
	SubdomainAcmeChallenge(w http.ResponseWriter, r *http.Request, subdomainId openapi_types.UUID)
}

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

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

GenerateSubdomain operation middleware

func (*ServerInterfaceWrapper) GetOverview

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

GetOverview operation middleware

func (*ServerInterfaceWrapper) SubdomainAcmeChallenge

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

SubdomainAcmeChallenge operation middleware

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 StrictHandlerFunc

type StrictHandlerFunc func(ctx context.Context, w http.ResponseWriter, r *http.Request, args interface{}) (interface{}, error)

type StrictMiddlewareFunc

type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc

type StrictServerInterface

type StrictServerInterface interface {
	// Server Overview
	// (GET /)
	GetOverview(ctx context.Context, request GetOverviewRequestObject) (GetOverviewResponseObject, error)
	// Request new subdomain
	// (POST /subdomain)
	GenerateSubdomain(ctx context.Context, request GenerateSubdomainRequestObject) (GenerateSubdomainResponseObject, error)
	// Set ACME challenge tokens
	// (POST /subdomain/{subdomainId}/acme-challenge)
	SubdomainAcmeChallenge(ctx context.Context, request SubdomainAcmeChallengeRequestObject) (SubdomainAcmeChallengeResponseObject, error)
}

StrictServerInterface represents all server handlers.

type SubdomainAcmeChallenge200Response

type SubdomainAcmeChallenge200Response struct {
}

func (SubdomainAcmeChallenge200Response) VisitSubdomainAcmeChallengeResponse

func (response SubdomainAcmeChallenge200Response) VisitSubdomainAcmeChallengeResponse(w http.ResponseWriter) error

type SubdomainAcmeChallenge403JSONResponse

type SubdomainAcmeChallenge403JSONResponse ErrorResponse

func (SubdomainAcmeChallenge403JSONResponse) VisitSubdomainAcmeChallengeResponse

func (response SubdomainAcmeChallenge403JSONResponse) VisitSubdomainAcmeChallengeResponse(w http.ResponseWriter) error

type SubdomainAcmeChallenge429JSONResponse

type SubdomainAcmeChallenge429JSONResponse ErrorResponse

func (SubdomainAcmeChallenge429JSONResponse) VisitSubdomainAcmeChallengeResponse

func (response SubdomainAcmeChallenge429JSONResponse) VisitSubdomainAcmeChallengeResponse(w http.ResponseWriter) error

type SubdomainAcmeChallengeJSONRequestBody

type SubdomainAcmeChallengeJSONRequestBody = SubdomainAcmeChallengeRequest

SubdomainAcmeChallengeJSONRequestBody defines body for SubdomainAcmeChallenge for application/json ContentType.

type SubdomainAcmeChallengeRequest

type SubdomainAcmeChallengeRequest struct {
	// Token Control Token.
	Token string `json:"token"`

	// Values ACME Tokens.
	Values []string `json:"values"`
}

SubdomainAcmeChallengeRequest Subdomain ACME Challenge Request.

type SubdomainAcmeChallengeRequestObject

type SubdomainAcmeChallengeRequestObject struct {
	SubdomainId openapi_types.UUID `json:"subdomainId"`
	Body        *SubdomainAcmeChallengeJSONRequestBody
}

type SubdomainAcmeChallengeResponseObject

type SubdomainAcmeChallengeResponseObject interface {
	VisitSubdomainAcmeChallengeResponse(w http.ResponseWriter) error
}

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