server

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

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

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

Types

type ChiServerOptions

type ChiServerOptions struct {
	BaseURL          string
	BaseRouter       chi.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 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 {

	// (POST /api/v1/certificatesigningrequests)
	CreateCertificateSigningRequest(w http.ResponseWriter, r *http.Request)

	// (GET /api/v1/certificatesigningrequests/{name})
	GetCertificateSigningRequest(w http.ResponseWriter, r *http.Request, name string)

	// (GET /api/v1/devices/{name}/rendered)
	GetRenderedDevice(w http.ResponseWriter, r *http.Request, name string, params GetRenderedDeviceParams)

	// (PATCH /api/v1/devices/{name}/status)
	PatchDeviceStatus(w http.ResponseWriter, r *http.Request, name string)

	// (PUT /api/v1/devices/{name}/status)
	ReplaceDeviceStatus(w http.ResponseWriter, r *http.Request, name string)

	// (POST /api/v1/enrollmentrequests)
	CreateEnrollmentRequest(w http.ResponseWriter, r *http.Request)

	// (GET /api/v1/enrollmentrequests/{name})
	GetEnrollmentRequest(w http.ResponseWriter, r *http.Request, name string)
}

ServerInterface represents all server handlers.

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) CreateCertificateSigningRequest added in v0.9.0

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

CreateCertificateSigningRequest operation middleware

func (*ServerInterfaceWrapper) CreateEnrollmentRequest

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

CreateEnrollmentRequest operation middleware

func (*ServerInterfaceWrapper) GetCertificateSigningRequest added in v0.9.0

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

GetCertificateSigningRequest operation middleware

func (*ServerInterfaceWrapper) GetEnrollmentRequest added in v0.9.0

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

GetEnrollmentRequest operation middleware

func (*ServerInterfaceWrapper) GetRenderedDevice added in v0.5.0

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

GetRenderedDevice operation middleware

func (*ServerInterfaceWrapper) PatchDeviceStatus added in v0.6.0

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

PatchDeviceStatus operation middleware

func (*ServerInterfaceWrapper) ReplaceDeviceStatus

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

ReplaceDeviceStatus operation middleware

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type Transport added in v0.6.0

type Transport interface {
	ServerInterface
}

Transport is a wrapper around the generated server interface.

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 Unimplemented

type Unimplemented struct{}

func (Unimplemented) CreateCertificateSigningRequest added in v0.9.0

func (_ Unimplemented) CreateCertificateSigningRequest(w http.ResponseWriter, r *http.Request)

(POST /api/v1/certificatesigningrequests)

func (Unimplemented) CreateEnrollmentRequest

func (_ Unimplemented) CreateEnrollmentRequest(w http.ResponseWriter, r *http.Request)

(POST /api/v1/enrollmentrequests)

func (Unimplemented) GetCertificateSigningRequest added in v0.9.0

func (_ Unimplemented) GetCertificateSigningRequest(w http.ResponseWriter, r *http.Request, name string)

(GET /api/v1/certificatesigningrequests/{name})

func (Unimplemented) GetEnrollmentRequest added in v0.9.0

func (_ Unimplemented) GetEnrollmentRequest(w http.ResponseWriter, r *http.Request, name string)

(GET /api/v1/enrollmentrequests/{name})

func (Unimplemented) GetRenderedDevice added in v0.5.0

func (_ Unimplemented) GetRenderedDevice(w http.ResponseWriter, r *http.Request, name string, params GetRenderedDeviceParams)

(GET /api/v1/devices/{name}/rendered)

func (Unimplemented) PatchDeviceStatus added in v0.6.0

func (_ Unimplemented) PatchDeviceStatus(w http.ResponseWriter, r *http.Request, name string)

(PATCH /api/v1/devices/{name}/status)

func (Unimplemented) ReplaceDeviceStatus

func (_ Unimplemented) ReplaceDeviceStatus(w http.ResponseWriter, r *http.Request, name string)

(PUT /api/v1/devices/{name}/status)

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