Documentation
¶
Overview ¶
Package domain provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT.
Index ¶
- Constants
- func Build(ctx context.Context, imports []string, paths []string) ([]*descriptorpb.FileDescriptorSet, error)
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r *mux.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r *mux.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options GorillaServerOptions) http.Handler
- type AddStubJSONBody
- type AddStubJSONRequestBody
- type Arguments
- type BatchStubsDeleteJSONRequestBody
- type Configure
- type GorillaServerOptions
- type ID
- type InvalidParamFormatError
- type ListID
- type MessageOK
- type Method
- type MiddlewareFunc
- type RequiredHeaderError
- type RequiredParamError
- type SearchRequest
- type SearchResponse
- type SearchStubsJSONRequestBody
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) AddStub(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) BatchStubsDelete(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteStubByID(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) FindByID(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListStubs(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListUnusedStubs(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListUsedStubs(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) Liveness(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PurgeStubs(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) Readiness(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) SearchStubs(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ServiceMethodsList(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ServicesList(w http.ResponseWriter, r *http.Request)
- type Service
- type ServingStatus
- type Stub
- type StubHeaders
- type StubInput
- type StubList
- type StubOutput
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type UnmarshalingParamError
Constants ¶
const ( Unknown = ServingStatus(healthv1.HealthCheckResponse_UNKNOWN) Serving = ServingStatus(healthv1.HealthCheckResponse_SERVING) NotServing = ServingStatus(healthv1.HealthCheckResponse_NOT_SERVING) ServiceUnknown = ServingStatus(healthv1.HealthCheckResponse_SERVICE_UNKNOWN) )
const ( ProtoExt = ".proto" ProtobufSetExt = ".pb" ProtoSetExt = ".protoset" )
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build(ctx context.Context, imports []string, paths []string) ([]*descriptorpb.FileDescriptorSet, error)
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 HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options GorillaServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
Types ¶
type AddStubJSONBody ¶
type AddStubJSONBody struct {
// contains filtered or unexported fields
}
AddStubJSONBody defines parameters for AddStub.
type AddStubJSONRequestBody ¶
type AddStubJSONRequestBody AddStubJSONBody
AddStubJSONRequestBody defines body for AddStub for application/json ContentType.
type Arguments ¶
type Arguments struct {
// contains filtered or unexported fields
}
Arguments represents the configuration for protobuf file processing.
type BatchStubsDeleteJSONRequestBody ¶
type BatchStubsDeleteJSONRequestBody = ListID
BatchStubsDeleteJSONRequestBody defines body for BatchStubsDelete for application/json ContentType.
type Configure ¶
type Configure struct {
// contains filtered or unexported fields
}
func (*Configure) Descriptors ¶
type GorillaServerOptions ¶
type GorillaServerOptions struct {
BaseURL string
BaseRouter *mux.Router
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type RequiredHeaderError ¶
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 SearchRequest ¶
type SearchRequest struct {
Data any `json:"data"`
Headers map[string]string `json:"headers,omitempty"`
Id *ID `json:"id,omitempty"`
Method string `json:"method"`
Service string `json:"service"`
}
SearchRequest defines model for SearchRequest.
type SearchResponse ¶
type SearchResponse struct {
Code *codes.Code `json:"code,omitempty"`
Data any `json:"data"`
Error string `json:"error"`
Headers map[string]string `json:"headers,omitempty"`
}
SearchResponse defines model for SearchResponse.
type SearchStubsJSONRequestBody ¶
type SearchStubsJSONRequestBody = SearchRequest
SearchStubsJSONRequestBody defines body for SearchStubs for application/json ContentType.
type ServerInterface ¶
type ServerInterface interface {
// Liveness check
// (GET /health/liveness)
Liveness(w http.ResponseWriter, r *http.Request)
// Readiness check
// (GET /health/readiness)
Readiness(w http.ResponseWriter, r *http.Request)
// Services
// (GET /services)
ServicesList(w http.ResponseWriter, r *http.Request)
// Service methods
// (GET /services/{serviceID}/methods)
ServiceMethodsList(w http.ResponseWriter, r *http.Request, serviceID string)
// Remove all stubs
// (DELETE /stubs)
PurgeStubs(w http.ResponseWriter, r *http.Request)
// Getting a list of stubs
// (GET /stubs)
ListStubs(w http.ResponseWriter, r *http.Request)
// Add a new stub to the store
// (POST /stubs)
AddStub(w http.ResponseWriter, r *http.Request)
// Deletes a batch of stubs by IDs
// (POST /stubs/batchDelete)
BatchStubsDelete(w http.ResponseWriter, r *http.Request)
// Stub storage search
// (POST /stubs/search)
SearchStubs(w http.ResponseWriter, r *http.Request)
// Getting a list of unused stubs
// (GET /stubs/unused)
ListUnusedStubs(w http.ResponseWriter, r *http.Request)
// Getting a list of used stubs
// (GET /stubs/used)
ListUsedStubs(w http.ResponseWriter, r *http.Request)
// Deletes stub by ID
// (DELETE /stubs/{uuid})
DeleteStubByID(w http.ResponseWriter, r *http.Request, uuid ID)
// Get Stub by ID
// (GET /stubs/{uuid})
FindByID(w http.ResponseWriter, r *http.Request, uuid ID)
}
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) AddStub ¶
func (siw *ServerInterfaceWrapper) AddStub(w http.ResponseWriter, r *http.Request)
AddStub operation middleware
func (*ServerInterfaceWrapper) BatchStubsDelete ¶
func (siw *ServerInterfaceWrapper) BatchStubsDelete(w http.ResponseWriter, r *http.Request)
BatchStubsDelete operation middleware
func (*ServerInterfaceWrapper) DeleteStubByID ¶
func (siw *ServerInterfaceWrapper) DeleteStubByID(w http.ResponseWriter, r *http.Request)
DeleteStubByID operation middleware
func (*ServerInterfaceWrapper) FindByID ¶
func (siw *ServerInterfaceWrapper) FindByID(w http.ResponseWriter, r *http.Request)
FindByID operation middleware
func (*ServerInterfaceWrapper) ListStubs ¶
func (siw *ServerInterfaceWrapper) ListStubs(w http.ResponseWriter, r *http.Request)
ListStubs operation middleware
func (*ServerInterfaceWrapper) ListUnusedStubs ¶
func (siw *ServerInterfaceWrapper) ListUnusedStubs(w http.ResponseWriter, r *http.Request)
ListUnusedStubs operation middleware
func (*ServerInterfaceWrapper) ListUsedStubs ¶
func (siw *ServerInterfaceWrapper) ListUsedStubs(w http.ResponseWriter, r *http.Request)
ListUsedStubs operation middleware
func (*ServerInterfaceWrapper) Liveness ¶
func (siw *ServerInterfaceWrapper) Liveness(w http.ResponseWriter, r *http.Request)
Liveness operation middleware
func (*ServerInterfaceWrapper) PurgeStubs ¶
func (siw *ServerInterfaceWrapper) PurgeStubs(w http.ResponseWriter, r *http.Request)
PurgeStubs operation middleware
func (*ServerInterfaceWrapper) Readiness ¶
func (siw *ServerInterfaceWrapper) Readiness(w http.ResponseWriter, r *http.Request)
Readiness operation middleware
func (*ServerInterfaceWrapper) SearchStubs ¶
func (siw *ServerInterfaceWrapper) SearchStubs(w http.ResponseWriter, r *http.Request)
SearchStubs operation middleware
func (*ServerInterfaceWrapper) ServiceMethodsList ¶
func (siw *ServerInterfaceWrapper) ServiceMethodsList(w http.ResponseWriter, r *http.Request)
ServiceMethodsList operation middleware
func (*ServerInterfaceWrapper) ServicesList ¶
func (siw *ServerInterfaceWrapper) ServicesList(w http.ResponseWriter, r *http.Request)
ServicesList operation middleware
type Service ¶
type Service struct {
Id string `json:"id"`
Methods []Method `json:"methods"`
Name string `json:"name"`
Package string `json:"package"`
}
Service defines model for Service.
type ServingStatus ¶
type ServingStatus uint32
type Stub ¶
type Stub struct {
Headers StubHeaders `json:"headers,omitempty"`
Id *ID `json:"id,omitempty"`
Input StubInput `json:"input"`
// Inputs Inputs to match against. If multiple inputs are provided, the stub will be matched if any of the inputs match.
Inputs *[]StubInput `json:"inputs,omitempty"`
Method string `json:"method"`
Output StubOutput `json:"output"`
// Priority Priority of the stub. Higher priority stubs are matched first.
Priority *int `json:"priority,omitempty"`
Service string `json:"service"`
}
Stub defines model for Stub.
type StubHeaders ¶
type StubHeaders struct {
Contains map[string]string `json:"contains,omitempty"`
Equals map[string]string `json:"equals,omitempty"`
Matches map[string]string `json:"matches,omitempty"`
}
StubHeaders defines model for StubHeaders.
type StubInput ¶
type StubInput struct {
Contains map[string]any `json:"contains,omitempty"`
Equals map[string]any `json:"equals,omitempty"`
IgnoreArrayOrder *bool `json:"ignoreArrayOrder,omitempty"`
Matches map[string]any `json:"matches,omitempty"`
}
StubInput defines model for StubInput.
type StubOutput ¶
type StubOutput struct {
Code *codes.Code `json:"code,omitempty"`
Data map[string]any `json:"data"`
Error string `json:"error"`
Headers map[string]string `json:"headers,omitempty"`
Stream []map[string]any `json:"stream,omitempty"`
}
StubOutput defines model for StubOutput.
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error