server

package
v0.0.0-...-6d7ca6c Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 9 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.7.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 AlreadyExistsJSONResponse

type AlreadyExistsJSONResponse Error

type BadRequestJSONResponse

type BadRequestJSONResponse Error

type ChiServerOptions

type ChiServerOptions struct {
	BaseURL          string
	BaseRouter       chi.Router
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type CreatePolicy201JSONResponse

type CreatePolicy201JSONResponse struct {
	Body    Policy
	Headers CreatePolicy201ResponseHeaders
}

func (CreatePolicy201JSONResponse) VisitCreatePolicyResponse

func (response CreatePolicy201JSONResponse) VisitCreatePolicyResponse(w http.ResponseWriter) error

type CreatePolicy201ResponseHeaders

type CreatePolicy201ResponseHeaders struct {
	Location *string
}

type CreatePolicy400JSONResponse

type CreatePolicy400JSONResponse struct{ BadRequestJSONResponse }

func (CreatePolicy400JSONResponse) VisitCreatePolicyResponse

func (response CreatePolicy400JSONResponse) VisitCreatePolicyResponse(w http.ResponseWriter) error

type CreatePolicy401JSONResponse

type CreatePolicy401JSONResponse struct{ UnauthorizedJSONResponse }

func (CreatePolicy401JSONResponse) VisitCreatePolicyResponse

func (response CreatePolicy401JSONResponse) VisitCreatePolicyResponse(w http.ResponseWriter) error

type CreatePolicy403JSONResponse

type CreatePolicy403JSONResponse struct{ ForbiddenJSONResponse }

func (CreatePolicy403JSONResponse) VisitCreatePolicyResponse

func (response CreatePolicy403JSONResponse) VisitCreatePolicyResponse(w http.ResponseWriter) error

type CreatePolicy409JSONResponse

type CreatePolicy409JSONResponse struct{ AlreadyExistsJSONResponse }

func (CreatePolicy409JSONResponse) VisitCreatePolicyResponse

func (response CreatePolicy409JSONResponse) VisitCreatePolicyResponse(w http.ResponseWriter) error

type CreatePolicy422JSONResponse

type CreatePolicy422JSONResponse struct{ ValidationErrorJSONResponse }

func (CreatePolicy422JSONResponse) VisitCreatePolicyResponse

func (response CreatePolicy422JSONResponse) VisitCreatePolicyResponse(w http.ResponseWriter) error

type CreatePolicy500JSONResponse

type CreatePolicy500JSONResponse struct {
	InternalServerErrorJSONResponse
}

func (CreatePolicy500JSONResponse) VisitCreatePolicyResponse

func (response CreatePolicy500JSONResponse) VisitCreatePolicyResponse(w http.ResponseWriter) error

type CreatePolicyRequestObject

type CreatePolicyRequestObject struct {
	Params CreatePolicyParams
	Body   *CreatePolicyJSONRequestBody
}

type CreatePolicyResponseObject

type CreatePolicyResponseObject interface {
	VisitCreatePolicyResponse(w http.ResponseWriter) error
}

type DeletePolicy204Response

type DeletePolicy204Response struct {
}

func (DeletePolicy204Response) VisitDeletePolicyResponse

func (response DeletePolicy204Response) VisitDeletePolicyResponse(w http.ResponseWriter) error

type DeletePolicy401JSONResponse

type DeletePolicy401JSONResponse struct{ UnauthorizedJSONResponse }

func (DeletePolicy401JSONResponse) VisitDeletePolicyResponse

func (response DeletePolicy401JSONResponse) VisitDeletePolicyResponse(w http.ResponseWriter) error

type DeletePolicy403JSONResponse

type DeletePolicy403JSONResponse struct{ ForbiddenJSONResponse }

func (DeletePolicy403JSONResponse) VisitDeletePolicyResponse

func (response DeletePolicy403JSONResponse) VisitDeletePolicyResponse(w http.ResponseWriter) error

type DeletePolicy404JSONResponse

type DeletePolicy404JSONResponse struct{ NotFoundJSONResponse }

func (DeletePolicy404JSONResponse) VisitDeletePolicyResponse

func (response DeletePolicy404JSONResponse) VisitDeletePolicyResponse(w http.ResponseWriter) error

type DeletePolicy500JSONResponse

type DeletePolicy500JSONResponse struct {
	InternalServerErrorJSONResponse
}

func (DeletePolicy500JSONResponse) VisitDeletePolicyResponse

func (response DeletePolicy500JSONResponse) VisitDeletePolicyResponse(w http.ResponseWriter) error

type DeletePolicyRequestObject

type DeletePolicyRequestObject struct {
	PolicyId PolicyIdPath `json:"policyId"`
}

type DeletePolicyResponseObject

type DeletePolicyResponseObject interface {
	VisitDeletePolicyResponse(w http.ResponseWriter) error
}

type ForbiddenJSONResponse

type ForbiddenJSONResponse Error

type GetPolicy200JSONResponse

type GetPolicy200JSONResponse Policy

func (GetPolicy200JSONResponse) VisitGetPolicyResponse

func (response GetPolicy200JSONResponse) VisitGetPolicyResponse(w http.ResponseWriter) error

type GetPolicy401JSONResponse

type GetPolicy401JSONResponse struct{ UnauthorizedJSONResponse }

func (GetPolicy401JSONResponse) VisitGetPolicyResponse

func (response GetPolicy401JSONResponse) VisitGetPolicyResponse(w http.ResponseWriter) error

type GetPolicy403JSONResponse

type GetPolicy403JSONResponse struct{ ForbiddenJSONResponse }

func (GetPolicy403JSONResponse) VisitGetPolicyResponse

func (response GetPolicy403JSONResponse) VisitGetPolicyResponse(w http.ResponseWriter) error

type GetPolicy404JSONResponse

type GetPolicy404JSONResponse struct{ NotFoundJSONResponse }

func (GetPolicy404JSONResponse) VisitGetPolicyResponse

func (response GetPolicy404JSONResponse) VisitGetPolicyResponse(w http.ResponseWriter) error

type GetPolicy500JSONResponse

type GetPolicy500JSONResponse struct {
	InternalServerErrorJSONResponse
}

func (GetPolicy500JSONResponse) VisitGetPolicyResponse

func (response GetPolicy500JSONResponse) VisitGetPolicyResponse(w http.ResponseWriter) error

type GetPolicyRequestObject

type GetPolicyRequestObject struct {
	PolicyId PolicyIdPath `json:"policyId"`
}

type GetPolicyResponseObject

type GetPolicyResponseObject interface {
	VisitGetPolicyResponse(w http.ResponseWriter) error
}

type InternalServerErrorJSONResponse

type InternalServerErrorJSONResponse 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 ListPolicies200JSONResponse

type ListPolicies200JSONResponse PolicyList

func (ListPolicies200JSONResponse) VisitListPoliciesResponse

func (response ListPolicies200JSONResponse) VisitListPoliciesResponse(w http.ResponseWriter) error

type ListPolicies400JSONResponse

type ListPolicies400JSONResponse struct{ BadRequestJSONResponse }

func (ListPolicies400JSONResponse) VisitListPoliciesResponse

func (response ListPolicies400JSONResponse) VisitListPoliciesResponse(w http.ResponseWriter) error

type ListPolicies401JSONResponse

type ListPolicies401JSONResponse struct{ UnauthorizedJSONResponse }

func (ListPolicies401JSONResponse) VisitListPoliciesResponse

func (response ListPolicies401JSONResponse) VisitListPoliciesResponse(w http.ResponseWriter) error

type ListPolicies403JSONResponse

type ListPolicies403JSONResponse struct{ ForbiddenJSONResponse }

func (ListPolicies403JSONResponse) VisitListPoliciesResponse

func (response ListPolicies403JSONResponse) VisitListPoliciesResponse(w http.ResponseWriter) error

type ListPolicies500JSONResponse

type ListPolicies500JSONResponse struct {
	InternalServerErrorJSONResponse
}

func (ListPolicies500JSONResponse) VisitListPoliciesResponse

func (response ListPolicies500JSONResponse) VisitListPoliciesResponse(w http.ResponseWriter) error

type ListPoliciesRequestObject

type ListPoliciesRequestObject struct {
	Params ListPoliciesParams
}

type ListPoliciesResponseObject

type ListPoliciesResponseObject interface {
	VisitListPoliciesResponse(w http.ResponseWriter) error
}

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type NotFoundJSONResponse

type NotFoundJSONResponse Error

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 {
	// List policies
	// (GET /policies)
	ListPolicies(w http.ResponseWriter, r *http.Request, params ListPoliciesParams)
	// Create a new policy
	// (POST /policies)
	CreatePolicy(w http.ResponseWriter, r *http.Request, params CreatePolicyParams)
	// Delete a policy
	// (DELETE /policies/{policyId})
	DeletePolicy(w http.ResponseWriter, r *http.Request, policyId PolicyIdPath)
	// Get a policy
	// (GET /policies/{policyId})
	GetPolicy(w http.ResponseWriter, r *http.Request, policyId PolicyIdPath)
	// Update a policy
	// (PATCH /policies/{policyId})
	UpdatePolicy(w http.ResponseWriter, r *http.Request, policyId PolicyIdPath)
}

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

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

CreatePolicy operation middleware

func (*ServerInterfaceWrapper) DeletePolicy

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

DeletePolicy operation middleware

func (*ServerInterfaceWrapper) GetPolicy

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

GetPolicy operation middleware

func (*ServerInterfaceWrapper) ListPolicies

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

ListPolicies operation middleware

func (*ServerInterfaceWrapper) UpdatePolicy

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

UpdatePolicy 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 {
	// List policies
	// (GET /policies)
	ListPolicies(ctx context.Context, request ListPoliciesRequestObject) (ListPoliciesResponseObject, error)
	// Create a new policy
	// (POST /policies)
	CreatePolicy(ctx context.Context, request CreatePolicyRequestObject) (CreatePolicyResponseObject, error)
	// Delete a policy
	// (DELETE /policies/{policyId})
	DeletePolicy(ctx context.Context, request DeletePolicyRequestObject) (DeletePolicyResponseObject, error)
	// Get a policy
	// (GET /policies/{policyId})
	GetPolicy(ctx context.Context, request GetPolicyRequestObject) (GetPolicyResponseObject, error)
	// Update a policy
	// (PATCH /policies/{policyId})
	UpdatePolicy(ctx context.Context, request UpdatePolicyRequestObject) (UpdatePolicyResponseObject, error)
}

StrictServerInterface represents all server handlers.

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UnauthorizedJSONResponse

type UnauthorizedJSONResponse 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 Unimplemented

type Unimplemented struct{}

func (Unimplemented) CreatePolicy

func (_ Unimplemented) CreatePolicy(w http.ResponseWriter, r *http.Request, params CreatePolicyParams)

Create a new policy (POST /policies)

func (Unimplemented) DeletePolicy

func (_ Unimplemented) DeletePolicy(w http.ResponseWriter, r *http.Request, policyId PolicyIdPath)

Delete a policy (DELETE /policies/{policyId})

func (Unimplemented) GetPolicy

func (_ Unimplemented) GetPolicy(w http.ResponseWriter, r *http.Request, policyId PolicyIdPath)

Get a policy (GET /policies/{policyId})

func (Unimplemented) ListPolicies

func (_ Unimplemented) ListPolicies(w http.ResponseWriter, r *http.Request, params ListPoliciesParams)

List policies (GET /policies)

func (Unimplemented) UpdatePolicy

func (_ Unimplemented) UpdatePolicy(w http.ResponseWriter, r *http.Request, policyId PolicyIdPath)

Update a policy (PATCH /policies/{policyId})

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 UpdatePolicy200JSONResponse

type UpdatePolicy200JSONResponse Policy

func (UpdatePolicy200JSONResponse) VisitUpdatePolicyResponse

func (response UpdatePolicy200JSONResponse) VisitUpdatePolicyResponse(w http.ResponseWriter) error

type UpdatePolicy400JSONResponse

type UpdatePolicy400JSONResponse struct{ BadRequestJSONResponse }

func (UpdatePolicy400JSONResponse) VisitUpdatePolicyResponse

func (response UpdatePolicy400JSONResponse) VisitUpdatePolicyResponse(w http.ResponseWriter) error

type UpdatePolicy401JSONResponse

type UpdatePolicy401JSONResponse struct{ UnauthorizedJSONResponse }

func (UpdatePolicy401JSONResponse) VisitUpdatePolicyResponse

func (response UpdatePolicy401JSONResponse) VisitUpdatePolicyResponse(w http.ResponseWriter) error

type UpdatePolicy403JSONResponse

type UpdatePolicy403JSONResponse struct{ ForbiddenJSONResponse }

func (UpdatePolicy403JSONResponse) VisitUpdatePolicyResponse

func (response UpdatePolicy403JSONResponse) VisitUpdatePolicyResponse(w http.ResponseWriter) error

type UpdatePolicy404JSONResponse

type UpdatePolicy404JSONResponse struct{ NotFoundJSONResponse }

func (UpdatePolicy404JSONResponse) VisitUpdatePolicyResponse

func (response UpdatePolicy404JSONResponse) VisitUpdatePolicyResponse(w http.ResponseWriter) error

type UpdatePolicy409JSONResponse

type UpdatePolicy409JSONResponse struct{ AlreadyExistsJSONResponse }

func (UpdatePolicy409JSONResponse) VisitUpdatePolicyResponse

func (response UpdatePolicy409JSONResponse) VisitUpdatePolicyResponse(w http.ResponseWriter) error

type UpdatePolicy500JSONResponse

type UpdatePolicy500JSONResponse struct {
	InternalServerErrorJSONResponse
}

func (UpdatePolicy500JSONResponse) VisitUpdatePolicyResponse

func (response UpdatePolicy500JSONResponse) VisitUpdatePolicyResponse(w http.ResponseWriter) error

type UpdatePolicyRequestObject

type UpdatePolicyRequestObject struct {
	PolicyId PolicyIdPath `json:"policyId"`
	Body     *UpdatePolicyApplicationMergePatchPlusJSONRequestBody
}

type UpdatePolicyResponseObject

type UpdatePolicyResponseObject interface {
	VisitUpdatePolicyResponse(w http.ResponseWriter) error
}

type ValidationErrorJSONResponse

type ValidationErrorJSONResponse Error

Jump to

Keyboard shortcuts

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