api

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

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

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.2 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 Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, r *mux.Router) http.Handler

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

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r *mux.Router, baseURL string) http.Handler

func HandlerWithOptions

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

type GetV1ConfigNamespaceName200JSONResponse V1Config

func (GetV1ConfigNamespaceName200JSONResponse) VisitGetV1ConfigNamespaceNameResponse

func (response GetV1ConfigNamespaceName200JSONResponse) VisitGetV1ConfigNamespaceNameResponse(w http.ResponseWriter) error

type GetV1ConfigNamespaceName404JSONResponse

type GetV1ConfigNamespaceName404JSONResponse V1Error

func (GetV1ConfigNamespaceName404JSONResponse) VisitGetV1ConfigNamespaceNameResponse

func (response GetV1ConfigNamespaceName404JSONResponse) VisitGetV1ConfigNamespaceNameResponse(w http.ResponseWriter) error

type GetV1ConfigNamespaceName500JSONResponse

type GetV1ConfigNamespaceName500JSONResponse V1Error

func (GetV1ConfigNamespaceName500JSONResponse) VisitGetV1ConfigNamespaceNameResponse

func (response GetV1ConfigNamespaceName500JSONResponse) VisitGetV1ConfigNamespaceNameResponse(w http.ResponseWriter) error

type GetV1ConfigNamespaceNameParams

type GetV1ConfigNamespaceNameParams struct {
	// Watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications.
	Watch *bool `form:"watch,omitempty" json:"watch,omitempty"`

	// Label A label describing the client, as key=value, repeated per label. The server hands the labels to its config patcher without interpreting them.
	Label *[]string `form:"label,omitempty" json:"label,omitempty"`
}

GetV1ConfigNamespaceNameParams defines parameters for GetV1ConfigNamespaceName.

type GetV1ConfigNamespaceNameRequestObject

type GetV1ConfigNamespaceNameRequestObject struct {
	Namespace string `json:"namespace"`
	Name      string `json:"name"`
	Params    GetV1ConfigNamespaceNameParams
}

type GetV1ConfigNamespaceNameResponseObject

type GetV1ConfigNamespaceNameResponseObject interface {
	VisitGetV1ConfigNamespaceNameResponse(w http.ResponseWriter) error
}

type GetV1ConfigNamespaceNamedefaultJSONResponse

type GetV1ConfigNamespaceNamedefaultJSONResponse struct {
	Body       V1Error
	StatusCode int
}

func (GetV1ConfigNamespaceNamedefaultJSONResponse) VisitGetV1ConfigNamespaceNameResponse

func (response GetV1ConfigNamespaceNamedefaultJSONResponse) VisitGetV1ConfigNamespaceNameResponse(w http.ResponseWriter) error

type GetV1LicenseStatus200JSONResponse

type GetV1LicenseStatus200JSONResponse V1LicenseStatus

func (GetV1LicenseStatus200JSONResponse) VisitGetV1LicenseStatusResponse

func (response GetV1LicenseStatus200JSONResponse) VisitGetV1LicenseStatusResponse(w http.ResponseWriter) error

type GetV1LicenseStatusRequestObject

type GetV1LicenseStatusRequestObject struct {
}

type GetV1LicenseStatusResponseObject

type GetV1LicenseStatusResponseObject interface {
	VisitGetV1LicenseStatusResponse(w http.ResponseWriter) error
}

type GetV1LicenseStatusdefaultJSONResponse

type GetV1LicenseStatusdefaultJSONResponse struct {
	Body       V1Error
	StatusCode int
}

func (GetV1LicenseStatusdefaultJSONResponse) VisitGetV1LicenseStatusResponse

func (response GetV1LicenseStatusdefaultJSONResponse) VisitGetV1LicenseStatusResponse(w http.ResponseWriter) error

type GorillaServerOptions

type GorillaServerOptions struct {
	BaseURL          string
	BaseRouter       *mux.Router
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err 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 ListV1Configs200JSONResponse

type ListV1Configs200JSONResponse V1ConfigList

func (ListV1Configs200JSONResponse) VisitListV1ConfigsResponse

func (response ListV1Configs200JSONResponse) VisitListV1ConfigsResponse(w http.ResponseWriter) error

type ListV1ConfigsNamespace200JSONResponse

type ListV1ConfigsNamespace200JSONResponse V1ConfigList

func (ListV1ConfigsNamespace200JSONResponse) VisitListV1ConfigsNamespaceResponse

func (response ListV1ConfigsNamespace200JSONResponse) VisitListV1ConfigsNamespaceResponse(w http.ResponseWriter) error

type ListV1ConfigsNamespaceParams

type ListV1ConfigsNamespaceParams struct {
	// Watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications.
	Watch *bool `form:"watch,omitempty" json:"watch,omitempty"`
}

ListV1ConfigsNamespaceParams defines parameters for ListV1ConfigsNamespace.

type ListV1ConfigsNamespaceRequestObject

type ListV1ConfigsNamespaceRequestObject struct {
	Namespace string `json:"namespace"`
	Params    ListV1ConfigsNamespaceParams
}

type ListV1ConfigsNamespaceResponseObject

type ListV1ConfigsNamespaceResponseObject interface {
	VisitListV1ConfigsNamespaceResponse(w http.ResponseWriter) error
}

type ListV1ConfigsNamespacedefaultJSONResponse

type ListV1ConfigsNamespacedefaultJSONResponse struct {
	Body       V1Error
	StatusCode int
}

func (ListV1ConfigsNamespacedefaultJSONResponse) VisitListV1ConfigsNamespaceResponse

func (response ListV1ConfigsNamespacedefaultJSONResponse) VisitListV1ConfigsNamespaceResponse(w http.ResponseWriter) error

type ListV1ConfigsParams

type ListV1ConfigsParams struct {
	// Watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications.
	Watch *bool `form:"watch,omitempty" json:"watch,omitempty"`
}

ListV1ConfigsParams defines parameters for ListV1Configs.

type ListV1ConfigsRequestObject

type ListV1ConfigsRequestObject struct {
	Params ListV1ConfigsParams
}

type ListV1ConfigsResponseObject

type ListV1ConfigsResponseObject interface {
	VisitListV1ConfigsResponse(w http.ResponseWriter) error
}

type ListV1ConfigsdefaultJSONResponse

type ListV1ConfigsdefaultJSONResponse struct {
	Body       V1Error
	StatusCode int
}

func (ListV1ConfigsdefaultJSONResponse) VisitListV1ConfigsResponse

func (response ListV1ConfigsdefaultJSONResponse) VisitListV1ConfigsResponse(w http.ResponseWriter) 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 ServerInterface

type ServerInterface interface {

	// (GET /api/v1/configs)
	ListV1Configs(w http.ResponseWriter, r *http.Request, params ListV1ConfigsParams)

	// (GET /api/v1/configs/{namespace})
	ListV1ConfigsNamespace(w http.ResponseWriter, r *http.Request, namespace string, params ListV1ConfigsNamespaceParams)

	// (GET /api/v1/configs/{namespace}/{name})
	GetV1ConfigNamespaceName(w http.ResponseWriter, r *http.Request, namespace string, name string, params GetV1ConfigNamespaceNameParams)

	// (GET /api/v1/license)
	GetV1LicenseStatus(w http.ResponseWriter, r *http.Request)
}

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

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

GetV1ConfigNamespaceName operation middleware

func (*ServerInterfaceWrapper) GetV1LicenseStatus

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

GetV1LicenseStatus operation middleware

func (*ServerInterfaceWrapper) ListV1Configs

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

ListV1Configs operation middleware

func (*ServerInterfaceWrapper) ListV1ConfigsNamespace

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

ListV1ConfigsNamespace 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, request any) (any, error)

type StrictMiddlewareFunc

type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc

type StrictServerInterface

type StrictServerInterface interface {

	// (GET /api/v1/configs)
	ListV1Configs(ctx context.Context, request ListV1ConfigsRequestObject) (ListV1ConfigsResponseObject, error)

	// (GET /api/v1/configs/{namespace})
	ListV1ConfigsNamespace(ctx context.Context, request ListV1ConfigsNamespaceRequestObject) (ListV1ConfigsNamespaceResponseObject, error)

	// (GET /api/v1/configs/{namespace}/{name})
	GetV1ConfigNamespaceName(ctx context.Context, request GetV1ConfigNamespaceNameRequestObject) (GetV1ConfigNamespaceNameResponseObject, error)

	// (GET /api/v1/license)
	GetV1LicenseStatus(ctx context.Context, request GetV1LicenseStatusRequestObject) (GetV1LicenseStatusResponseObject, 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

type V1Config

type V1Config = stunnerv2.StunnerConfig

V1Config Config provides a STUNner config. Schema is defined in https://github.com/l7mp/stunner/tree/main/pkg/apis/v2

type V1ConfigList

type V1ConfigList struct {
	// Items Items is the list of Config objects in the list.
	Items []V1Config `json:"items"`

	// Version version defines the versioned schema of this object.
	Version string `json:"version"`
}

V1ConfigList ConfigList is a list of Configs.

type V1Error

type V1Error struct {
	// Code Error code.
	Code int32 `json:"code"`

	// Message Error message.
	Message string `json:"message"`
}

V1Error API error.

type V1LicenseStatus

type V1LicenseStatus = stunnerv2.LicenseStatus

V1LicenseStatus LicenseStatus provides the license status. Schema is defined in https://github.com/l7mp/stunner/tree/main/pkg/apis/v2

Jump to

Keyboard shortcuts

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