generated

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package generated contains the generated Echo 5 health server contract.

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSpec

func GetSpec() (swagger *openapi3.T, err error)

GetSpec returns the OpenAPI specification corresponding to the generated code in this file. External references in the spec are resolved through PathToRawSpec; externally-referenced files must be embedded in their corresponding Go packages (via the import-mapping feature). URL-based external refs are not supported.

func GetSpecJSON

func GetSpecJSON() ([]byte, error)

GetSpecJSON returns the raw JSON bytes of the embedded OpenAPI specification: decompressed but not unmarshaled. External references are not resolved here; the bytes are the spec exactly as embedded by codegen. The result is cached at package init time, so repeated calls are cheap.

func GetSwagger deprecated

func GetSwagger() (*openapi3.T, error)

GetSwagger returns the OpenAPI specification corresponding to the generated code in this file.

Deprecated: GetSwagger predates kin-openapi renaming openapi3.Swagger to openapi3.T. Use GetSpec instead. This wrapper is retained for backwards compatibility.

func PathToRawSpec

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

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

func RegisterHandlers

func RegisterHandlers(router EchoRouter, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

func RegisterHandlersWithBaseURL

func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)

RegisterHandlersWithBaseURL registers handlers and prepends BaseURL to the paths so the API can be served under a prefix.

func RegisterHandlersWithOptions

func RegisterHandlersWithOptions(router EchoRouter, si ServerInterface, options RegisterHandlersOptions)

RegisterHandlersWithOptions registers handlers using the supplied options, including any per-operation middleware.

Types

type BadRequest

type BadRequest = ProblemDetails

BadRequest defines model for BadRequest.

type BadRequestApplicationProblemPlusJSONResponse

type BadRequestApplicationProblemPlusJSONResponse ProblemDetails

type CheckResult

type CheckResult struct {
	Critical bool        `json:"critical"`
	Name     string      `json:"name"`
	Status   ProbeStatus `json:"status"`
}

CheckResult defines model for CheckResult.

type EchoRouter

This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration

type GetLivenessProbe200JSONResponse

type GetLivenessProbe200JSONResponse struct{ ProbeSucceededJSONResponse }

func (GetLivenessProbe200JSONResponse) VisitGetLivenessProbeResponse

func (response GetLivenessProbe200JSONResponse) VisitGetLivenessProbeResponse(w http.ResponseWriter) error

type GetLivenessProbeRequestObject

type GetLivenessProbeRequestObject struct {
}

type GetLivenessProbeResponseObject

type GetLivenessProbeResponseObject interface {
	VisitGetLivenessProbeResponse(w http.ResponseWriter) error
}

type GetReadinessProbe200JSONResponse

type GetReadinessProbe200JSONResponse struct{ ProbeSucceededJSONResponse }

func (GetReadinessProbe200JSONResponse) VisitGetReadinessProbeResponse

func (response GetReadinessProbe200JSONResponse) VisitGetReadinessProbeResponse(w http.ResponseWriter) error

type GetReadinessProbe400ApplicationProblemPlusJSONResponse

type GetReadinessProbe400ApplicationProblemPlusJSONResponse struct {
	BadRequestApplicationProblemPlusJSONResponse
}

func (GetReadinessProbe400ApplicationProblemPlusJSONResponse) VisitGetReadinessProbeResponse

func (response GetReadinessProbe400ApplicationProblemPlusJSONResponse) VisitGetReadinessProbeResponse(w http.ResponseWriter) error

type GetReadinessProbe503JSONResponse

type GetReadinessProbe503JSONResponse struct{ ProbeFailedJSONResponse }

func (GetReadinessProbe503JSONResponse) VisitGetReadinessProbeResponse

func (response GetReadinessProbe503JSONResponse) VisitGetReadinessProbeResponse(w http.ResponseWriter) error

type GetReadinessProbeParams

type GetReadinessProbeParams struct {
	Verbose *bool `form:"verbose,omitempty" json:"verbose,omitempty"`
}

GetReadinessProbeParams defines parameters for GetReadinessProbe.

type GetReadinessProbeRequestObject

type GetReadinessProbeRequestObject struct {
	Params GetReadinessProbeParams
}

type GetReadinessProbeResponseObject

type GetReadinessProbeResponseObject interface {
	VisitGetReadinessProbeResponse(w http.ResponseWriter) error
}

type ProbeFailed

type ProbeFailed = ProbeResponse

ProbeFailed defines model for ProbeFailed.

type ProbeFailedJSONResponse

type ProbeFailedJSONResponse ProbeResponse

type ProbeResponse

type ProbeResponse struct {
	Checks *[]CheckResult `json:"checks,omitempty"`
	Status ProbeStatus    `json:"status"`
}

ProbeResponse defines model for ProbeResponse.

type ProbeStatus

type ProbeStatus string

ProbeStatus defines model for ProbeStatus.

const (
	Fail ProbeStatus = "fail"
	Ok   ProbeStatus = "ok"
)

Defines values for ProbeStatus.

func (ProbeStatus) Valid

func (e ProbeStatus) Valid() bool

Valid indicates whether the value is a known member of the ProbeStatus enum.

type ProbeSucceeded

type ProbeSucceeded = ProbeResponse

ProbeSucceeded defines model for ProbeSucceeded.

type ProbeSucceededJSONResponse

type ProbeSucceededJSONResponse ProbeResponse

type ProblemDetails

type ProblemDetails struct {
	Retryable ProblemDetailsRetryable `json:"retryable"`
	Status    ProblemDetailsStatus    `json:"status"`
	Title     string                  `json:"title"`
	Type      ProblemDetailsType      `json:"type"`
}

ProblemDetails defines model for ProblemDetails.

type ProblemDetailsRetryable

type ProblemDetailsRetryable bool

ProblemDetailsRetryable defines model for ProblemDetails.Retryable.

const (
	False ProblemDetailsRetryable = false
)

Defines values for ProblemDetailsRetryable.

func (ProblemDetailsRetryable) Valid

func (e ProblemDetailsRetryable) Valid() bool

Valid indicates whether the value is a known member of the ProblemDetailsRetryable enum.

type ProblemDetailsStatus

type ProblemDetailsStatus int

ProblemDetailsStatus defines model for ProblemDetails.Status.

const (
	N400 ProblemDetailsStatus = 400
)

Defines values for ProblemDetailsStatus.

func (ProblemDetailsStatus) Valid

func (e ProblemDetailsStatus) Valid() bool

Valid indicates whether the value is a known member of the ProblemDetailsStatus enum.

type ProblemDetailsType

type ProblemDetailsType string

ProblemDetailsType defines model for ProblemDetails.Type.

const (
	ProblemsbadRequest ProblemDetailsType = "/problems/bad-request"
)

Defines values for ProblemDetailsType.

func (ProblemDetailsType) Valid

func (e ProblemDetailsType) Valid() bool

Valid indicates whether the value is a known member of the ProblemDetailsType enum.

type RegisterHandlersOptions

type RegisterHandlersOptions struct {
	// BaseURL is prepended to every registered path so the API can be served
	// under a prefix.
	BaseURL string
	// OperationMiddlewares lets the caller attach per-operation middleware at
	// registration time. The map key is the OpenAPI `operationId` value as it
	// appears in the spec (the raw, un-normalized form). Operations that have
	// no entry are registered with no extra middleware. A nil map disables
	// per-operation middleware entirely.
	OperationMiddlewares map[string][]echo.MiddlewareFunc
}

RegisterHandlersOptions configures RegisterHandlersWithOptions.

type ServerInterface

type ServerInterface interface {
	// GetLivenessProbe Report whether the health server is live.
	// (GET /livez)
	GetLivenessProbe(ctx *echo.Context) error
	// GetReadinessProbe Report whether the application can receive traffic.
	// (GET /readyz)
	GetReadinessProbe(ctx *echo.Context, params GetReadinessProbeParams) error
}

ServerInterface represents all server handlers.

func NewStrictHandler

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

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) GetLivenessProbe

func (w *ServerInterfaceWrapper) GetLivenessProbe(ctx *echo.Context) error

GetLivenessProbe converts echo context to params.

func (*ServerInterfaceWrapper) GetReadinessProbe

func (w *ServerInterfaceWrapper) GetReadinessProbe(ctx *echo.Context) error

GetReadinessProbe converts echo context to params.

type StrictHandlerFunc

type StrictHandlerFunc func(ctx *echo.Context, request any) (any, error)

type StrictMiddlewareFunc

type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc

type StrictServerInterface

type StrictServerInterface interface {
	// GetLivenessProbe Report whether the health server is live.
	// (GET /livez)
	GetLivenessProbe(ctx context.Context, request GetLivenessProbeRequestObject) (GetLivenessProbeResponseObject, error)
	// GetReadinessProbe Report whether the application can receive traffic.
	// (GET /readyz)
	GetReadinessProbe(ctx context.Context, request GetReadinessProbeRequestObject) (GetReadinessProbeResponseObject, error)
}

StrictServerInterface represents all server handlers.

Jump to

Keyboard shortcuts

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