Documentation
¶
Overview ¶
Package rest provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.
Index ¶
- 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 AddDescriptorsResponse
- type AddStub200JSONResponseBody
- func (t AddStub200JSONResponseBody) AsListID() (ListID, error)
- func (t *AddStub200JSONResponseBody) FromListID(v ListID) error
- func (t AddStub200JSONResponseBody) MarshalJSON() ([]byte, error)
- func (t *AddStub200JSONResponseBody) MergeListID(v ListID) error
- func (t *AddStub200JSONResponseBody) UnmarshalJSON(b []byte) error
- type AddStubJSONBody
- func (t AddStubJSONBody) AsStub() (Stub, error)
- func (t AddStubJSONBody) AsStubList() (StubList, error)
- func (t *AddStubJSONBody) FromStub(v Stub) error
- func (t *AddStubJSONBody) FromStubList(v StubList) error
- func (t AddStubJSONBody) MarshalJSON() ([]byte, error)
- func (t *AddStubJSONBody) MergeStub(v Stub) error
- func (t *AddStubJSONBody) MergeStubList(v StubList) error
- func (t *AddStubJSONBody) UnmarshalJSON(b []byte) error
- type AddStubJSONRequestBody
- type BatchStubsDeleteJSONRequestBody
- type CallRecord
- type Dashboard
- type DashboardInfo
- type DashboardOverview
- type DescriptorServiceIDs
- type GorillaServerOptions
- type HistoryList
- type ID
- type InspectCandidate
- type InspectCandidateEvent
- type InspectReport
- type InspectRequest
- type InspectStage
- type InspectStubsJSONRequestBody
- type InvalidParamFormatError
- type ListHistoryParams
- type ListID
- type ListStubsParams
- type MessageOK
- type Method
- type MethodMethodType
- type MiddlewareFunc
- type ProtoFieldSchema
- type ProtoFieldSchemaCardinality
- type ProtoMessageSchema
- type RequiredHeaderError
- type RequiredParamError
- type SearchRequest
- type SearchResponse
- type SearchStubsJSONRequestBody
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) AddDescriptors(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) AddStub(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) BatchStubsDelete(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) Dashboard(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DashboardInfo(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DashboardOverview(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteService(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) InspectStubs(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListDescriptors(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListHistory(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) ServiceGet(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ServiceMethodGet(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)
- func (siw *ServerInterfaceWrapper) SessionsList(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ValidateStub(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) VerifyCalls(w http.ResponseWriter, r *http.Request)
- type Service
- type Sessions
- type Stub
- type StubEffect
- type StubEffectAction
- type StubHeaders
- type StubHeadersAnyOfElement
- type StubInput
- type StubInputAnyOfElement
- type StubList
- type StubOptions
- type StubOutput
- type StubOutput_Details_Item
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type UnmarshalingParamError
- type ValidateStub200JSONResponseBody
- func (t ValidateStub200JSONResponseBody) AsStubList() (StubList, error)
- func (t *ValidateStub200JSONResponseBody) FromStubList(v StubList) error
- func (t ValidateStub200JSONResponseBody) MarshalJSON() ([]byte, error)
- func (t *ValidateStub200JSONResponseBody) MergeStubList(v StubList) error
- func (t *ValidateStub200JSONResponseBody) UnmarshalJSON(b []byte) error
- type ValidateStubJSONBody
- func (t ValidateStubJSONBody) AsStub() (Stub, error)
- func (t ValidateStubJSONBody) AsStubList() (StubList, error)
- func (t *ValidateStubJSONBody) FromStub(v Stub) error
- func (t *ValidateStubJSONBody) FromStubList(v StubList) error
- func (t ValidateStubJSONBody) MarshalJSON() ([]byte, error)
- func (t *ValidateStubJSONBody) MergeStub(v Stub) error
- func (t *ValidateStubJSONBody) MergeStubList(v StubList) error
- func (t *ValidateStubJSONBody) UnmarshalJSON(b []byte) error
- type ValidateStubJSONRequestBody
- type VerifyCallsJSONRequestBody
- type VerifyError
- type VerifyRequest
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 *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 AddDescriptorsResponse ¶ added in v3.7.0
type AddDescriptorsResponse struct {
Message string `json:"message"`
// ServiceIDs Service IDs (e.g. helloworld.Greeter) registered. Use DELETE /services/{serviceID} to remove.
ServiceIDs []string `json:"serviceIDs"`
Time time.Time `json:"time"`
}
AddDescriptorsResponse defines model for AddDescriptorsResponse.
type AddStub200JSONResponseBody ¶ added in v3.13.0
type AddStub200JSONResponseBody struct {
// contains filtered or unexported fields
}
AddStub200JSONResponseBody defines parameters for AddStub.
func (AddStub200JSONResponseBody) AsListID ¶ added in v3.13.0
func (t AddStub200JSONResponseBody) AsListID() (ListID, error)
AsListID returns the union data inside the AddStub200JSONResponseBody as a ListID
func (*AddStub200JSONResponseBody) FromListID ¶ added in v3.13.0
func (t *AddStub200JSONResponseBody) FromListID(v ListID) error
FromListID overwrites any union data inside the AddStub200JSONResponseBody as the provided ListID
func (AddStub200JSONResponseBody) MarshalJSON ¶ added in v3.13.0
func (t AddStub200JSONResponseBody) MarshalJSON() ([]byte, error)
func (*AddStub200JSONResponseBody) MergeListID ¶ added in v3.13.0
func (t *AddStub200JSONResponseBody) MergeListID(v ListID) error
MergeListID performs a merge with any union data inside the AddStub200JSONResponseBody, using the provided ListID
func (*AddStub200JSONResponseBody) UnmarshalJSON ¶ added in v3.13.0
func (t *AddStub200JSONResponseBody) UnmarshalJSON(b []byte) error
type AddStubJSONBody ¶
type AddStubJSONBody struct {
// contains filtered or unexported fields
}
AddStubJSONBody defines parameters for AddStub.
func (AddStubJSONBody) AsStub ¶ added in v3.13.0
func (t AddStubJSONBody) AsStub() (Stub, error)
AsStub returns the union data inside the AddStubJSONBody as a Stub
func (AddStubJSONBody) AsStubList ¶ added in v3.13.0
func (t AddStubJSONBody) AsStubList() (StubList, error)
AsStubList returns the union data inside the AddStubJSONBody as a StubList
func (*AddStubJSONBody) FromStub ¶ added in v3.13.0
func (t *AddStubJSONBody) FromStub(v Stub) error
FromStub overwrites any union data inside the AddStubJSONBody as the provided Stub
func (*AddStubJSONBody) FromStubList ¶ added in v3.13.0
func (t *AddStubJSONBody) FromStubList(v StubList) error
FromStubList overwrites any union data inside the AddStubJSONBody as the provided StubList
func (AddStubJSONBody) MarshalJSON ¶ added in v3.13.0
func (t AddStubJSONBody) MarshalJSON() ([]byte, error)
func (*AddStubJSONBody) MergeStub ¶ added in v3.13.0
func (t *AddStubJSONBody) MergeStub(v Stub) error
MergeStub performs a merge with any union data inside the AddStubJSONBody, using the provided Stub
func (*AddStubJSONBody) MergeStubList ¶ added in v3.13.0
func (t *AddStubJSONBody) MergeStubList(v StubList) error
MergeStubList performs a merge with any union data inside the AddStubJSONBody, using the provided StubList
func (*AddStubJSONBody) UnmarshalJSON ¶ added in v3.13.0
func (t *AddStubJSONBody) UnmarshalJSON(b []byte) error
type AddStubJSONRequestBody ¶
type AddStubJSONRequestBody AddStubJSONBody
AddStubJSONRequestBody defines body for AddStub for application/json ContentType.
type BatchStubsDeleteJSONRequestBody ¶
type BatchStubsDeleteJSONRequestBody = ListID
BatchStubsDeleteJSONRequestBody defines body for BatchStubsDelete for application/json ContentType.
type CallRecord ¶ added in v3.7.0
type CallRecord struct {
// Code gRPC status code (e.g., 0 for OK, 5 for NotFound)
Code *int `json:"code,omitempty"`
// ElapsedMs Handler duration in milliseconds
ElapsedMs *int64 `json:"elapsedMs,omitempty"`
Error *string `json:"error,omitempty"`
Method *string `json:"method,omitempty"`
// Request Deprecated: use requests for streaming calls
// Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set
Request *map[string]any `json:"request,omitempty"`
// Requests Request messages for streaming calls (client stream, bidi stream)
Requests *[]map[string]any `json:"requests,omitempty"`
// Response Deprecated: use responses for streaming calls
// Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set
Response *map[string]any `json:"response,omitempty"`
// Responses Response messages for streaming calls (server stream, bidi stream)
Responses *[]map[string]any `json:"responses,omitempty"`
Service *string `json:"service,omitempty"`
// Session Session ID (empty = global)
Session *string `json:"session,omitempty"`
// StubId Stub identifier
StubId *uuid.UUID `json:"stubId,omitempty"`
Timestamp *time.Time `json:"timestamp,omitempty"`
}
CallRecord defines model for CallRecord.
type Dashboard ¶ added in v3.8.2
type Dashboard struct {
AppName string `json:"appName"`
Compiler string `json:"compiler"`
// CoveredMethods Number of gRPC methods that have at least one stub
CoveredMethods int `json:"coveredMethods,omitempty"`
// GatewayAddr ConnectRPC + gRPC-web listen address
GatewayAddr string `json:"gatewayAddr,omitempty"`
GoVersion string `json:"goVersion"`
Goarch string `json:"goarch"`
Goos string `json:"goos"`
// GrpcAddr Native gRPC listen address
GrpcAddr string `json:"grpcAddr,omitempty"`
HistoryEnabled bool `json:"historyEnabled"`
HistoryErrors int `json:"historyErrors"`
// HttpAddr Admin REST API + UI listen address
HttpAddr string `json:"httpAddr,omitempty"`
NumCPU int `json:"numCPU"`
Ready bool `json:"ready"`
RuntimeDescriptors int `json:"runtimeDescriptors"`
StartedAt time.Time `json:"startedAt"`
TotalHistory int `json:"totalHistory"`
// TotalMethods Total number of gRPC methods across all services
TotalMethods int `json:"totalMethods,omitempty"`
TotalServices int `json:"totalServices"`
TotalSessions int `json:"totalSessions"`
TotalStubs int `json:"totalStubs"`
UnusedStubs int `json:"unusedStubs"`
UptimeSeconds int `json:"uptimeSeconds"`
UsedStubs int `json:"usedStubs"`
Version string `json:"version"`
}
Dashboard defines model for Dashboard.
type DashboardInfo ¶ added in v3.8.2
type DashboardInfo struct {
AppName string `json:"appName"`
Compiler string `json:"compiler"`
GoVersion string `json:"goVersion"`
Goarch string `json:"goarch"`
Goos string `json:"goos"`
HistoryEnabled bool `json:"historyEnabled"`
NumCPU int `json:"numCPU"`
Ready bool `json:"ready"`
RuntimeDescriptors int `json:"runtimeDescriptors"`
StartedAt time.Time `json:"startedAt"`
TotalServices int `json:"totalServices"`
TotalSessions int `json:"totalSessions"`
TotalStubs int `json:"totalStubs"`
UptimeSeconds int `json:"uptimeSeconds"`
Version string `json:"version"`
}
DashboardInfo defines model for DashboardInfo.
type DashboardOverview ¶ added in v3.8.2
type DashboardOverview struct {
// CoveredMethods Number of gRPC methods that have at least one stub
CoveredMethods int `json:"coveredMethods,omitempty"`
// GatewayAddr ConnectRPC + gRPC-web listen address
GatewayAddr string `json:"gatewayAddr,omitempty"`
// GrpcAddr Native gRPC listen address
GrpcAddr string `json:"grpcAddr,omitempty"`
HistoryErrors int `json:"historyErrors"`
// HttpAddr Admin REST API + UI listen address
HttpAddr string `json:"httpAddr,omitempty"`
RuntimeDescriptors int `json:"runtimeDescriptors"`
TotalHistory int `json:"totalHistory"`
// TotalMethods Total number of gRPC methods across all services
TotalMethods int `json:"totalMethods,omitempty"`
TotalServices int `json:"totalServices"`
TotalSessions int `json:"totalSessions"`
TotalStubs int `json:"totalStubs"`
UnusedStubs int `json:"unusedStubs"`
UsedStubs int `json:"usedStubs"`
}
DashboardOverview defines model for DashboardOverview.
type DescriptorServiceIDs ¶ added in v3.7.0
type DescriptorServiceIDs struct {
// ServiceIDs Service IDs added via POST /descriptors
ServiceIDs []string `json:"serviceIDs"`
}
DescriptorServiceIDs defines model for DescriptorServiceIDs.
type GorillaServerOptions ¶
type GorillaServerOptions struct {
BaseURL string
BaseRouter *mux.Router
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type HistoryList ¶ added in v3.7.0
type HistoryList = []CallRecord
HistoryList defines model for HistoryList.
type InspectCandidate ¶ added in v3.8.2
type InspectCandidate struct {
Events []InspectCandidateEvent `json:"events"`
ExcludedBy []string `json:"excludedBy"`
HeadersMatched bool `json:"headersMatched"`
Id string `json:"id"`
InputMatched bool `json:"inputMatched"`
Matched bool `json:"matched"`
Method string `json:"method"`
Priority int `json:"priority"`
Score float64 `json:"score"`
Service string `json:"service"`
Session string `json:"session"`
Specificity int `json:"specificity"`
Times int `json:"times"`
Used int `json:"used"`
VisibleBySession bool `json:"visibleBySession"`
WithinTimes bool `json:"withinTimes"`
}
InspectCandidate defines model for InspectCandidate.
type InspectCandidateEvent ¶ added in v3.8.2
type InspectCandidateEvent struct {
Reason *string `json:"reason,omitempty"`
Result string `json:"result"`
Stage string `json:"stage"`
}
InspectCandidateEvent defines model for InspectCandidateEvent.
type InspectReport ¶ added in v3.8.2
type InspectReport struct {
Candidates []InspectCandidate `json:"candidates"`
Error string `json:"error"`
FallbackToMethod bool `json:"fallbackToMethod"`
MatchedStubId string `json:"matchedStubId"`
Method string `json:"method"`
Service string `json:"service"`
Session string `json:"session"`
SimilarStubId string `json:"similarStubId"`
Stages []InspectStage `json:"stages"`
}
InspectReport defines model for InspectReport.
type InspectRequest ¶ added in v3.8.2
type InspectRequest struct {
Headers map[string]any `json:"headers,omitempty"`
// Id Example: 51c50050-ec27-4dae-a583-a32ca71a1dd5
Id *ID `json:"id,omitempty"`
Input []map[string]any `json:"input,omitempty"`
Method string `json:"method"`
Service string `json:"service"`
Session *string `json:"session,omitempty"`
}
InspectRequest defines model for InspectRequest.
type InspectStage ¶ added in v3.8.2
type InspectStage struct {
After int `json:"after"`
Before int `json:"before"`
Name string `json:"name"`
Removed int `json:"removed"`
}
InspectStage defines model for InspectStage.
type InspectStubsJSONRequestBody ¶ added in v3.8.2
type InspectStubsJSONRequestBody = InspectRequest
InspectStubsJSONRequestBody defines body for InspectStubs for application/json ContentType.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type ListHistoryParams ¶ added in v3.18.0
type ListHistoryParams struct {
// Limit Return at most N most-recent records
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
// Offset Skip the N newest records (page backward through older calls)
Offset *int `form:"offset,omitempty" json:"offset,omitempty"`
Service *string `form:"service,omitempty" json:"service,omitempty"`
Method *string `form:"method,omitempty" json:"method,omitempty"`
// Error When true, return only calls that ended with a gRPC error
Error *bool `form:"error,omitempty" json:"error,omitempty"`
}
ListHistoryParams defines parameters for ListHistory.
type ListStubsParams ¶ added in v3.10.1
type ListStubsParams struct {
// Source Filter by source (file, rest, mcp, proxy)
Source *string `form:"source,omitempty" json:"source,omitempty"`
// Service Filter by service name (exact match)
Service *string `form:"service,omitempty" json:"service,omitempty"`
// Method Filter by method name (exact match)
Method *string `form:"method,omitempty" json:"method,omitempty"`
// Session Filter by session ID (empty means global stubs)
Session *string `form:"session,omitempty" json:"session,omitempty"`
// Q Case-insensitive substring search over service, method and stub ID
Q *string `form:"q,omitempty" json:"q,omitempty"`
// Matcher Filter by matcher kind(s) present on the stub input. Comma-separated for OR semantics (e.g. "glob,anyOf"). Valid kinds: equals, contains, matches, glob, anyOf.
Matcher *string `form:"matcher,omitempty" json:"matcher,omitempty"`
// Limit Maximum number of returned stubs
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
// Offset Number of stubs to skip before returning results
Offset *int `form:"offset,omitempty" json:"offset,omitempty"`
// Sort Sort order for result list
Sort *string `form:"sort,omitempty" json:"sort,omitempty"`
}
ListStubsParams defines parameters for ListStubs.
type Method ¶
type Method struct {
// ClientStreaming Indicates client-side streaming method
ClientStreaming bool `json:"clientStreaming,omitempty"`
Id string `json:"id"`
// MethodType gRPC method interaction type
MethodType MethodMethodType `json:"methodType"`
Name string `json:"name"`
RequestSchema *ProtoMessageSchema `json:"requestSchema,omitempty"`
// RequestType Fully-qualified protobuf request message type
RequestType *string `json:"requestType,omitempty"`
ResponseSchema *ProtoMessageSchema `json:"responseSchema,omitempty"`
// ResponseType Fully-qualified protobuf response message type
ResponseType *string `json:"responseType,omitempty"`
// ServerStreaming Indicates server-side streaming method
ServerStreaming bool `json:"serverStreaming,omitempty"`
}
Method defines model for Method.
type MethodMethodType ¶ added in v3.8.2
type MethodMethodType string
MethodMethodType gRPC method interaction type
const ( BidiStreaming MethodMethodType = "bidi_streaming" ClientStreaming MethodMethodType = "client_streaming" ServerStreaming MethodMethodType = "server_streaming" Unary MethodMethodType = "unary" )
Defines values for MethodMethodType.
func (MethodMethodType) Valid ¶ added in v3.8.2
func (e MethodMethodType) Valid() bool
Valid indicates whether the value is a known member of the MethodMethodType enum.
type ProtoFieldSchema ¶ added in v3.8.2
type ProtoFieldSchema struct {
Cardinality ProtoFieldSchemaCardinality `json:"cardinality"`
EnumValues *[]string `json:"enumValues,omitempty"`
JsonName string `json:"jsonName"`
Kind string `json:"kind"`
Map bool `json:"map,omitempty"`
MapKeyKind *string `json:"mapKeyKind,omitempty"`
MapValueKind *string `json:"mapValueKind,omitempty"`
MapValueMessage *ProtoMessageSchema `json:"mapValueMessage,omitempty"`
MapValueTypeName *string `json:"mapValueTypeName,omitempty"`
Message *ProtoMessageSchema `json:"message,omitempty"`
Name string `json:"name"`
Number int `json:"number"`
// Oneof Oneof group name if field belongs to oneof
Oneof *string `json:"oneof,omitempty"`
// TypeName Referenced protobuf type for message/enum fields
TypeName *string `json:"typeName,omitempty"`
}
ProtoFieldSchema defines model for ProtoFieldSchema.
type ProtoFieldSchemaCardinality ¶ added in v3.8.2
type ProtoFieldSchemaCardinality string
ProtoFieldSchemaCardinality defines model for ProtoFieldSchema.Cardinality.
const ( Optional ProtoFieldSchemaCardinality = "optional" Repeated ProtoFieldSchemaCardinality = "repeated" Required ProtoFieldSchemaCardinality = "required" )
Defines values for ProtoFieldSchemaCardinality.
func (ProtoFieldSchemaCardinality) Valid ¶ added in v3.8.2
func (e ProtoFieldSchemaCardinality) Valid() bool
Valid indicates whether the value is a known member of the ProtoFieldSchemaCardinality enum.
type ProtoMessageSchema ¶ added in v3.8.2
type ProtoMessageSchema struct {
Fields []ProtoFieldSchema `json:"fields"`
// RecursiveRef True when schema expansion stopped due to recursive reference
RecursiveRef bool `json:"recursiveRef,omitempty"`
// TypeName Fully-qualified protobuf message type name
TypeName string `json:"typeName"`
}
ProtoMessageSchema defines model for ProtoMessageSchema.
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 Example: 51c50050-ec27-4dae-a583-a32ca71a1dd5
Id *ID `json:"id,omitempty"`
// Method Example: SayHello
Method string `json:"method"`
// Service Example: Gripmock
Service string `json:"service"`
}
SearchRequest defines model for SearchRequest.
type SearchResponse ¶
type SearchResponse struct {
// Code Example: 3
Code codes.Code `json:"code,omitempty"`
Data any `json:"data"`
// Error Example: Message not found
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 {
// Dashboard Dashboard aggregate payload
// (GET /dashboard)
Dashboard(w http.ResponseWriter, r *http.Request)
// DashboardInfo Dashboard runtime and build info
// (GET /dashboard/info)
DashboardInfo(w http.ResponseWriter, r *http.Request)
// DashboardOverview Dashboard overview metrics
// (GET /dashboard/overview)
DashboardOverview(w http.ResponseWriter, r *http.Request)
// ListDescriptors List service IDs from REST-added descriptors
// (GET /descriptors)
ListDescriptors(w http.ResponseWriter, r *http.Request)
// AddDescriptors Upload FileDescriptorSet
// (POST /descriptors)
AddDescriptors(w http.ResponseWriter, r *http.Request)
// Liveness Liveness check
// (GET /health/liveness)
Liveness(w http.ResponseWriter, r *http.Request)
// Readiness Readiness check
// (GET /health/readiness)
Readiness(w http.ResponseWriter, r *http.Request)
// ListHistory Get call history
// (GET /history)
ListHistory(w http.ResponseWriter, r *http.Request, params ListHistoryParams)
// ServicesList Services
// (GET /services)
ServicesList(w http.ResponseWriter, r *http.Request)
// DeleteService Remove service
// (DELETE /services/{serviceID})
DeleteService(w http.ResponseWriter, r *http.Request, serviceID string)
// ServiceGet Service details
// (GET /services/{serviceID})
ServiceGet(w http.ResponseWriter, r *http.Request, serviceID string)
// ServiceMethodsList Service methods
// (GET /services/{serviceID}/methods)
ServiceMethodsList(w http.ResponseWriter, r *http.Request, serviceID string)
// ServiceMethodGet Service method details
// (GET /services/{serviceID}/methods/{methodID})
ServiceMethodGet(w http.ResponseWriter, r *http.Request, serviceID string, methodID string)
// SessionsList Session options
// (GET /sessions)
SessionsList(w http.ResponseWriter, r *http.Request)
// PurgeStubs Remove all stubs
// (DELETE /stubs)
PurgeStubs(w http.ResponseWriter, r *http.Request)
// ListStubs Getting a list of stubs
// (GET /stubs)
ListStubs(w http.ResponseWriter, r *http.Request, params ListStubsParams)
// AddStub Add a new stub to the store
// (POST /stubs)
AddStub(w http.ResponseWriter, r *http.Request)
// BatchStubsDelete Deletes a batch of stubs by IDs
// (POST /stubs/batchDelete)
BatchStubsDelete(w http.ResponseWriter, r *http.Request)
// InspectStubs Inspect stub matching decision path
// (POST /stubs/inspect)
InspectStubs(w http.ResponseWriter, r *http.Request)
// SearchStubs Stub storage search
// (POST /stubs/search)
SearchStubs(w http.ResponseWriter, r *http.Request)
// ListUnusedStubs Getting a list of unused stubs
// (GET /stubs/unused)
ListUnusedStubs(w http.ResponseWriter, r *http.Request)
// ListUsedStubs Getting a list of used stubs
// (GET /stubs/used)
ListUsedStubs(w http.ResponseWriter, r *http.Request)
// ValidateStub Validate a stub payload without persisting
// (POST /stubs/validate)
ValidateStub(w http.ResponseWriter, r *http.Request)
// DeleteStubByID Deletes stub by ID
// (DELETE /stubs/{uuid})
DeleteStubByID(w http.ResponseWriter, r *http.Request, uuid ID)
// FindByID Get Stub by ID
// (GET /stubs/{uuid})
FindByID(w http.ResponseWriter, r *http.Request, uuid ID)
// VerifyCalls Verify call counts
// (POST /verify)
VerifyCalls(w http.ResponseWriter, r *http.Request)
}
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) AddDescriptors ¶ added in v3.7.0
func (siw *ServerInterfaceWrapper) AddDescriptors(w http.ResponseWriter, r *http.Request)
AddDescriptors operation middleware
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) Dashboard ¶ added in v3.8.2
func (siw *ServerInterfaceWrapper) Dashboard(w http.ResponseWriter, r *http.Request)
Dashboard operation middleware
func (*ServerInterfaceWrapper) DashboardInfo ¶ added in v3.8.2
func (siw *ServerInterfaceWrapper) DashboardInfo(w http.ResponseWriter, r *http.Request)
DashboardInfo operation middleware
func (*ServerInterfaceWrapper) DashboardOverview ¶ added in v3.8.2
func (siw *ServerInterfaceWrapper) DashboardOverview(w http.ResponseWriter, r *http.Request)
DashboardOverview operation middleware
func (*ServerInterfaceWrapper) DeleteService ¶ added in v3.7.0
func (siw *ServerInterfaceWrapper) DeleteService(w http.ResponseWriter, r *http.Request)
DeleteService 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) InspectStubs ¶ added in v3.8.2
func (siw *ServerInterfaceWrapper) InspectStubs(w http.ResponseWriter, r *http.Request)
InspectStubs operation middleware
func (*ServerInterfaceWrapper) ListDescriptors ¶ added in v3.7.0
func (siw *ServerInterfaceWrapper) ListDescriptors(w http.ResponseWriter, r *http.Request)
ListDescriptors operation middleware
func (*ServerInterfaceWrapper) ListHistory ¶ added in v3.7.0
func (siw *ServerInterfaceWrapper) ListHistory(w http.ResponseWriter, r *http.Request)
ListHistory 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) ServiceGet ¶ added in v3.8.2
func (siw *ServerInterfaceWrapper) ServiceGet(w http.ResponseWriter, r *http.Request)
ServiceGet operation middleware
func (*ServerInterfaceWrapper) ServiceMethodGet ¶ added in v3.8.2
func (siw *ServerInterfaceWrapper) ServiceMethodGet(w http.ResponseWriter, r *http.Request)
ServiceMethodGet 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
func (*ServerInterfaceWrapper) SessionsList ¶ added in v3.8.2
func (siw *ServerInterfaceWrapper) SessionsList(w http.ResponseWriter, r *http.Request)
SessionsList operation middleware
func (*ServerInterfaceWrapper) ValidateStub ¶ added in v3.18.0
func (siw *ServerInterfaceWrapper) ValidateStub(w http.ResponseWriter, r *http.Request)
ValidateStub operation middleware
func (*ServerInterfaceWrapper) VerifyCalls ¶ added in v3.7.0
func (siw *ServerInterfaceWrapper) VerifyCalls(w http.ResponseWriter, r *http.Request)
VerifyCalls 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 Sessions ¶ added in v3.8.2
type Sessions struct {
Sessions []string `json:"sessions"`
}
Sessions defines model for Sessions.
type Stub ¶
type Stub struct {
// Effects Side effects applied after successful stub match
Effects []StubEffect `json:"effects,omitempty"`
Headers StubHeaders `json:"headers,omitempty"`
// Id Example: 51c50050-ec27-4dae-a583-a32ca71a1dd5
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 Example: SayHello
Method string `json:"method"`
// Options Optional behavior settings for a stub
Options *StubOptions `json:"options,omitempty,omitzero"`
Output StubOutput `json:"output"`
// Priority Priority of the stub. Higher priority stubs are matched first.
Priority int `json:"priority,omitempty"`
// Service Example: Gripmock
Service string `json:"service"`
// Source Source of the stub (file, rest, mcp, proxy)
Source *string `json:"source,omitempty,omitzero"`
// Used Response-only — whether the stub has matched at least once. Ignored on input.
Used bool `json:"used,omitempty"`
}
Stub defines model for Stub.
type StubEffect ¶ added in v3.11.1
type StubEffect struct {
Action StubEffectAction `json:"action"`
// Id Stub UUID for delete action
Id string `json:"id,omitempty"`
// Stub Stub payload for upsert action
Stub map[string]any `json:"stub,omitempty"`
}
StubEffect defines model for StubEffect.
type StubEffectAction ¶ added in v3.11.1
type StubEffectAction string
StubEffectAction defines model for StubEffect.Action.
const ( Delete StubEffectAction = "delete" Upsert StubEffectAction = "upsert" )
Defines values for StubEffectAction.
func (StubEffectAction) Valid ¶ added in v3.11.1
func (e StubEffectAction) Valid() bool
Valid indicates whether the value is a known member of the StubEffectAction enum.
type StubHeaders ¶
type StubHeaders struct {
// AnyOf Alternative header matchers (OR logic)
AnyOf []StubHeadersAnyOfElement `json:"anyOf,omitempty"`
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 StubHeadersAnyOfElement ¶ added in v3.11.1
type StubHeadersAnyOfElement struct {
Contains map[string]string `json:"contains,omitempty"`
Equals map[string]string `json:"equals,omitempty"`
Matches map[string]string `json:"matches,omitempty"`
}
StubHeadersAnyOfElement defines model for StubHeadersAnyOfElement.
type StubInput ¶
type StubInput struct {
// AnyOf Alternative input matchers (OR logic)
AnyOf []StubInputAnyOfElement `json:"anyOf,omitempty"`
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 StubInputAnyOfElement ¶ added in v3.11.1
type StubInputAnyOfElement 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"`
}
StubInputAnyOfElement defines model for StubInputAnyOfElement.
type StubOptions ¶ added in v3.7.0
type StubOptions struct {
// Times Max number of matches; 0 = unlimited
Times int `json:"times,omitempty"`
}
StubOptions Optional behavior settings for a stub
type StubOutput ¶
type StubOutput struct {
// Code Example: 3
Code codes.Code `json:"code,omitempty"`
Data any `json:"data,omitempty"`
// Delay Delay before sending the response
//
// Example: 1s
Delay gptypes.Duration `json:"delay,omitempty,omitzero"`
// Details gRPC status details packed into google.protobuf.Any (each item must contain type URL in `type`)
Details []StubOutput_Details_Item `json:"details,omitempty"`
// Error Example: Message not found
Error string `json:"error,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Stream []any `json:"stream,omitempty"`
}
StubOutput defines model for StubOutput.
type StubOutput_Details_Item ¶ added in v3.8.0
type StubOutput_Details_Item struct {
// Type Full Any type URL (for example, type.googleapis.com/google.rpc.ErrorInfo)
Type string `json:"type"`
AdditionalProperties map[string]any `json:"-"`
}
StubOutput_Details_Item defines model for StubOutput.details.Item.
func (StubOutput_Details_Item) Get ¶ added in v3.8.0
func (a StubOutput_Details_Item) Get(fieldName string) (value any, found bool)
Getter for additional properties for StubOutput_Details_Item. Returns the specified element and whether it was found
func (StubOutput_Details_Item) MarshalJSON ¶ added in v3.8.0
func (a StubOutput_Details_Item) MarshalJSON() ([]byte, error)
Override default JSON handling for StubOutput_Details_Item to handle AdditionalProperties
func (*StubOutput_Details_Item) Set ¶ added in v3.8.0
func (a *StubOutput_Details_Item) Set(fieldName string, value any)
Setter for additional properties for StubOutput_Details_Item
func (*StubOutput_Details_Item) UnmarshalJSON ¶ added in v3.8.0
func (a *StubOutput_Details_Item) UnmarshalJSON(b []byte) error
Override default JSON handling for StubOutput_Details_Item to handle AdditionalProperties
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
type ValidateStub200JSONResponseBody ¶ added in v3.18.0
type ValidateStub200JSONResponseBody struct {
// contains filtered or unexported fields
}
ValidateStub200JSONResponseBody defines parameters for ValidateStub.
func (ValidateStub200JSONResponseBody) AsStubList ¶ added in v3.18.0
func (t ValidateStub200JSONResponseBody) AsStubList() (StubList, error)
AsStubList returns the union data inside the ValidateStub200JSONResponseBody as a StubList
func (*ValidateStub200JSONResponseBody) FromStubList ¶ added in v3.18.0
func (t *ValidateStub200JSONResponseBody) FromStubList(v StubList) error
FromStubList overwrites any union data inside the ValidateStub200JSONResponseBody as the provided StubList
func (ValidateStub200JSONResponseBody) MarshalJSON ¶ added in v3.18.0
func (t ValidateStub200JSONResponseBody) MarshalJSON() ([]byte, error)
func (*ValidateStub200JSONResponseBody) MergeStubList ¶ added in v3.18.0
func (t *ValidateStub200JSONResponseBody) MergeStubList(v StubList) error
MergeStubList performs a merge with any union data inside the ValidateStub200JSONResponseBody, using the provided StubList
func (*ValidateStub200JSONResponseBody) UnmarshalJSON ¶ added in v3.18.0
func (t *ValidateStub200JSONResponseBody) UnmarshalJSON(b []byte) error
type ValidateStubJSONBody ¶ added in v3.18.0
type ValidateStubJSONBody struct {
// contains filtered or unexported fields
}
ValidateStubJSONBody defines parameters for ValidateStub.
func (ValidateStubJSONBody) AsStub ¶ added in v3.18.0
func (t ValidateStubJSONBody) AsStub() (Stub, error)
AsStub returns the union data inside the ValidateStubJSONBody as a Stub
func (ValidateStubJSONBody) AsStubList ¶ added in v3.18.0
func (t ValidateStubJSONBody) AsStubList() (StubList, error)
AsStubList returns the union data inside the ValidateStubJSONBody as a StubList
func (*ValidateStubJSONBody) FromStub ¶ added in v3.18.0
func (t *ValidateStubJSONBody) FromStub(v Stub) error
FromStub overwrites any union data inside the ValidateStubJSONBody as the provided Stub
func (*ValidateStubJSONBody) FromStubList ¶ added in v3.18.0
func (t *ValidateStubJSONBody) FromStubList(v StubList) error
FromStubList overwrites any union data inside the ValidateStubJSONBody as the provided StubList
func (ValidateStubJSONBody) MarshalJSON ¶ added in v3.18.0
func (t ValidateStubJSONBody) MarshalJSON() ([]byte, error)
func (*ValidateStubJSONBody) MergeStub ¶ added in v3.18.0
func (t *ValidateStubJSONBody) MergeStub(v Stub) error
MergeStub performs a merge with any union data inside the ValidateStubJSONBody, using the provided Stub
func (*ValidateStubJSONBody) MergeStubList ¶ added in v3.18.0
func (t *ValidateStubJSONBody) MergeStubList(v StubList) error
MergeStubList performs a merge with any union data inside the ValidateStubJSONBody, using the provided StubList
func (*ValidateStubJSONBody) UnmarshalJSON ¶ added in v3.18.0
func (t *ValidateStubJSONBody) UnmarshalJSON(b []byte) error
type ValidateStubJSONRequestBody ¶ added in v3.18.0
type ValidateStubJSONRequestBody ValidateStubJSONBody
ValidateStubJSONRequestBody defines body for ValidateStub for application/json ContentType.
type VerifyCallsJSONRequestBody ¶ added in v3.7.0
type VerifyCallsJSONRequestBody = VerifyRequest
VerifyCallsJSONRequestBody defines body for VerifyCalls for application/json ContentType.
type VerifyError ¶ added in v3.7.0
type VerifyError struct {
Actual *int `json:"actual,omitempty"`
Expected *int `json:"expected,omitempty"`
Message *string `json:"message,omitempty"`
}
VerifyError defines model for VerifyError.
type VerifyRequest ¶ added in v3.7.0
type VerifyRequest struct {
ExpectedCount int `json:"expectedCount"`
Method string `json:"method"`
Service string `json:"service"`
}
VerifyRequest defines model for VerifyRequest.