gen

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

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

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

Package gen contains generated code for the facts API.

Index

Constants

View Source
const (
	BearerAuthScopes bearerAuthContextKey = "BearerAuth.Scopes"
)

Variables

This section is empty.

Functions

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

type FactKeyEntry struct {
	// Builtin Whether this is a built-in fact key.
	Builtin *bool `json:"builtin,omitempty"`

	// Description Human-readable description of the fact.
	Description *string `json:"description,omitempty"`

	// Key The fact key (e.g. "interface.primary").
	Key string `json:"key"`
}

FactKeyEntry defines model for FactKeyEntry.

type FactKeysResponse

type FactKeysResponse struct {
	// Keys Available fact keys for @fact. references.
	Keys []FactKeyEntry `json:"keys"`
}

FactKeysResponse defines model for FactKeysResponse.

type GetFactKeys200JSONResponse

type GetFactKeys200JSONResponse FactKeysResponse

func (GetFactKeys200JSONResponse) VisitGetFactKeysResponse

func (response GetFactKeys200JSONResponse) VisitGetFactKeysResponse(w http.ResponseWriter) error

type GetFactKeys401JSONResponse

type GetFactKeys401JSONResponse externalRef0.ErrorResponse

func (GetFactKeys401JSONResponse) VisitGetFactKeysResponse

func (response GetFactKeys401JSONResponse) VisitGetFactKeysResponse(w http.ResponseWriter) error

type GetFactKeys403JSONResponse

type GetFactKeys403JSONResponse externalRef0.ErrorResponse

func (GetFactKeys403JSONResponse) VisitGetFactKeysResponse

func (response GetFactKeys403JSONResponse) VisitGetFactKeysResponse(w http.ResponseWriter) error

type GetFactKeys500JSONResponse

type GetFactKeys500JSONResponse externalRef0.ErrorResponse

func (GetFactKeys500JSONResponse) VisitGetFactKeysResponse

func (response GetFactKeys500JSONResponse) VisitGetFactKeysResponse(w http.ResponseWriter) error

type GetFactKeysRequestObject

type GetFactKeysRequestObject struct {
}

type GetFactKeysResponseObject

type GetFactKeysResponseObject interface {
	VisitGetFactKeysResponse(w http.ResponseWriter) error
}

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 {
	// List available fact keys
	// (GET /api/facts/keys)
	GetFactKeys(ctx *echo.Context) 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) GetFactKeys

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

GetFactKeys 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 {
	// List available fact keys
	// (GET /api/facts/keys)
	GetFactKeys(ctx context.Context, request GetFactKeysRequestObject) (GetFactKeysResponseObject, error)
}

StrictServerInterface represents all server handlers.

Jump to

Keyboard shortcuts

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