engineserver

package
v0.0.0-...-8a644c6 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

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

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

type BadRequest = Error

BadRequest defines model for BadRequest.

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 Error

type Error struct {
	// Detail Detailed error message
	Detail *string `json:"detail,omitempty"`

	// Instance Request identifier
	Instance *string `json:"instance,omitempty"`

	// Status HTTP status code
	Status int32 `json:"status"`

	// Title Short error summary
	Title string `json:"title"`

	// Type Error type identifier
	Type string `json:"type"`
}

Error defines model for Error.

type EvaluateRequest

type EvaluateRequest struct {
	ServiceInstance ServiceInstance `json:"service_instance"`
}

EvaluateRequest defines model for EvaluateRequest.

type EvaluateRequest200JSONResponse

type EvaluateRequest200JSONResponse EvaluateResponse

func (EvaluateRequest200JSONResponse) VisitEvaluateRequestResponse

func (response EvaluateRequest200JSONResponse) VisitEvaluateRequestResponse(w http.ResponseWriter) error

type EvaluateRequest400JSONResponse

type EvaluateRequest400JSONResponse struct{ BadRequestJSONResponse }

func (EvaluateRequest400JSONResponse) VisitEvaluateRequestResponse

func (response EvaluateRequest400JSONResponse) VisitEvaluateRequestResponse(w http.ResponseWriter) error

type EvaluateRequest401JSONResponse

type EvaluateRequest401JSONResponse struct{ UnauthorizedJSONResponse }

func (EvaluateRequest401JSONResponse) VisitEvaluateRequestResponse

func (response EvaluateRequest401JSONResponse) VisitEvaluateRequestResponse(w http.ResponseWriter) error

type EvaluateRequest403JSONResponse

type EvaluateRequest403JSONResponse struct{ ForbiddenJSONResponse }

func (EvaluateRequest403JSONResponse) VisitEvaluateRequestResponse

func (response EvaluateRequest403JSONResponse) VisitEvaluateRequestResponse(w http.ResponseWriter) error

type EvaluateRequest406JSONResponse

type EvaluateRequest406JSONResponse struct{ RejectedJSONResponse }

func (EvaluateRequest406JSONResponse) VisitEvaluateRequestResponse

func (response EvaluateRequest406JSONResponse) VisitEvaluateRequestResponse(w http.ResponseWriter) error

type EvaluateRequest409JSONResponse

type EvaluateRequest409JSONResponse struct{ PolicyConflictJSONResponse }

func (EvaluateRequest409JSONResponse) VisitEvaluateRequestResponse

func (response EvaluateRequest409JSONResponse) VisitEvaluateRequestResponse(w http.ResponseWriter) error

type EvaluateRequest500JSONResponse

type EvaluateRequest500JSONResponse struct {
	InternalServerErrorJSONResponse
}

func (EvaluateRequest500JSONResponse) VisitEvaluateRequestResponse

func (response EvaluateRequest500JSONResponse) VisitEvaluateRequestResponse(w http.ResponseWriter) error

type EvaluateRequestJSONRequestBody

type EvaluateRequestJSONRequestBody = EvaluateRequest

EvaluateRequestJSONRequestBody defines body for EvaluateRequest for application/json ContentType.

type EvaluateRequestRequestObject

type EvaluateRequestRequestObject struct {
	Body *EvaluateRequestJSONRequestBody
}

type EvaluateRequestResponseObject

type EvaluateRequestResponseObject interface {
	VisitEvaluateRequestResponse(w http.ResponseWriter) error
}

type EvaluateResponse

type EvaluateResponse struct {
	EvaluatedServiceInstance ServiceInstance `json:"evaluated_service_instance"`

	// SelectedProvider Service provider selected by policies
	SelectedProvider string `json:"selected_provider"`

	// Status APPROVED - Request unchanged by policies
	// MODIFIED - Request was modified by policies
	Status EvaluateResponseStatus `json:"status"`
}

EvaluateResponse defines model for EvaluateResponse.

type EvaluateResponseStatus

type EvaluateResponseStatus string

EvaluateResponseStatus APPROVED - Request unchanged by policies MODIFIED - Request was modified by policies

const (
	APPROVED EvaluateResponseStatus = "APPROVED"
	MODIFIED EvaluateResponseStatus = "MODIFIED"
)

Defines values for EvaluateResponseStatus.

type Forbidden

type Forbidden = Error

Forbidden defines model for Forbidden.

type ForbiddenJSONResponse

type ForbiddenJSONResponse Error

type InternalServerError

type InternalServerError = Error

InternalServerError defines model for InternalServerError.

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 MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type PolicyConflict

type PolicyConflict = Error

PolicyConflict defines model for PolicyConflict.

type PolicyConflictJSONResponse

type PolicyConflictJSONResponse Error

type Rejected

type Rejected = Error

Rejected defines model for Rejected.

type RejectedJSONResponse

type RejectedJSONResponse 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 {
	// Evaluate request payload against policies
	// (POST /policies:evaluateRequest)
	EvaluateRequest(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) EvaluateRequest

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

EvaluateRequest operation middleware

type ServiceInstance

type ServiceInstance struct {
	// Spec Service specification (flexible schema)
	Spec map[string]interface{} `json:"spec"`
}

ServiceInstance defines model for ServiceInstance.

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 StrictServerInterface

type StrictServerInterface interface {
	// Evaluate request payload against policies
	// (POST /policies:evaluateRequest)
	EvaluateRequest(ctx context.Context, request EvaluateRequestRequestObject) (EvaluateRequestResponseObject, error)
}

StrictServerInterface represents all server handlers.

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type Unauthorized

type Unauthorized = Error

Unauthorized defines model for Unauthorized.

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

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

Evaluate request payload against policies (POST /policies:evaluateRequest)

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