Documentation
¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.15.0 DO NOT EDIT.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func NewCreateExpectationRequest(server string, body CreateExpectationJSONRequestBody) (*http.Request, error)
- func NewCreateExpectationRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewGetExpectationsRequest(server string, params *GetExpectationsParams) (*http.Request, error)
- func NewGetLogsRequest(server string, params *GetLogsParams) (*http.Request, error)
- func NewGetRoutesRequest(server string) (*http.Request, error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RegisterHandlers(router EchoRouter, si ServerInterface)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
- type BadRequest
- type Callback
- type Client
- func (c *Client) CreateExpectation(ctx context.Context, body CreateExpectationJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) CreateExpectationWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) GetExpectations(ctx context.Context, params *GetExpectationsParams, ...) (*http.Response, error)
- func (c *Client) GetLogs(ctx context.Context, params *GetLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetRoutes(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) CreateExpectationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*CreateExpectationResponse, error)
- func (c *ClientWithResponses) CreateExpectationWithResponse(ctx context.Context, body CreateExpectationJSONRequestBody, ...) (*CreateExpectationResponse, error)
- func (c *ClientWithResponses) GetExpectationsWithResponse(ctx context.Context, params *GetExpectationsParams, ...) (*GetExpectationsResponse, error)
- func (c *ClientWithResponses) GetLogsWithResponse(ctx context.Context, params *GetLogsParams, reqEditors ...RequestEditorFn) (*GetLogsResponse, error)
- func (c *ClientWithResponses) GetRoutesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetRoutesResponse, error)
- type ClientWithResponsesInterface
- type CreateExpectationJSONRequestBody
- type CreateExpectationResponse
- type DolusApi
- type DolusApiImpl
- type EchoRouter
- type ErrorResponseBody
- type Expectation
- type ExpectationTypeParameter
- type Expectations
- type GeneralError
- type GetExpectationsParams
- type GetExpectationsParamsExpectationType
- type GetExpectationsParamsMethod
- type GetExpectationsResponse
- type GetLogsParams
- type GetLogsResponse
- type GetRoutesResponse
- type HttpRequestDoer
- type InternalServerError
- type Mapper
- type MapperImpl
- type MapperMock
- func (_m *MapperMock) EXPECT() *MapperMock_Expecter
- func (_m *MapperMock) MapToApiExpectation(_a0 expectation.Expectation) (*Expectation, error)
- func (_m *MapperMock) MapToApiExpectations(expectations []expectation.Expectation) ([]Expectation, error)
- func (_m *MapperMock) MapToExpectation(_a0 Expectation) (*expectation.Expectation, error)
- type MapperMock_Expecter
- func (_e *MapperMock_Expecter) MapToApiExpectation(_a0 interface{}) *MapperMock_MapToApiExpectation_Call
- func (_e *MapperMock_Expecter) MapToApiExpectations(expectations interface{}) *MapperMock_MapToApiExpectations_Call
- func (_e *MapperMock_Expecter) MapToExpectation(_a0 interface{}) *MapperMock_MapToExpectation_Call
- type MapperMock_MapToApiExpectation_Call
- func (_c *MapperMock_MapToApiExpectation_Call) Return(_a0 *Expectation, _a1 error) *MapperMock_MapToApiExpectation_Call
- func (_c *MapperMock_MapToApiExpectation_Call) Run(run func(_a0 expectation.Expectation)) *MapperMock_MapToApiExpectation_Call
- func (_c *MapperMock_MapToApiExpectation_Call) RunAndReturn(run func(expectation.Expectation) (*Expectation, error)) *MapperMock_MapToApiExpectation_Call
- type MapperMock_MapToApiExpectations_Call
- func (_c *MapperMock_MapToApiExpectations_Call) Return(_a0 []Expectation, _a1 error) *MapperMock_MapToApiExpectations_Call
- func (_c *MapperMock_MapToApiExpectations_Call) Run(run func(expectations []expectation.Expectation)) *MapperMock_MapToApiExpectations_Call
- func (_c *MapperMock_MapToApiExpectations_Call) RunAndReturn(run func([]expectation.Expectation) ([]Expectation, error)) *MapperMock_MapToApiExpectations_Call
- type MapperMock_MapToExpectation_Call
- func (_c *MapperMock_MapToExpectation_Call) Return(_a0 *expectation.Expectation, _a1 error) *MapperMock_MapToExpectation_Call
- func (_c *MapperMock_MapToExpectation_Call) Run(run func(_a0 Expectation)) *MapperMock_MapToExpectation_Call
- func (_c *MapperMock_MapToExpectation_Call) RunAndReturn(run func(Expectation) (*expectation.Expectation, error)) *MapperMock_MapToExpectation_Call
- type MethodParameter
- type PathParameter
- type Request
- type RequestEditorFn
- type Response
- type Route
- type ServerInterface
- type ServerInterfaceWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
func NewCreateExpectationRequest ¶
func NewCreateExpectationRequest(server string, body CreateExpectationJSONRequestBody) (*http.Request, error)
NewCreateExpectationRequest calls the generic CreateExpectation builder with application/json body
func NewCreateExpectationRequestWithBody ¶
func NewCreateExpectationRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewCreateExpectationRequestWithBody generates requests for CreateExpectation with any type of body
func NewGetExpectationsRequest ¶
func NewGetExpectationsRequest(server string, params *GetExpectationsParams) (*http.Request, error)
NewGetExpectationsRequest generates requests for GetExpectations
func NewGetLogsRequest ¶
func NewGetLogsRequest(server string, params *GetLogsParams) (*http.Request, error)
NewGetLogsRequest generates requests for GetLogs
func NewGetRoutesRequest ¶
NewGetRoutesRequest generates requests for GetRoutes
func PathToRawSpec ¶
Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
func RegisterHandlers ¶
func RegisterHandlers(router EchoRouter, si ServerInterface)
RegisterHandlers adds each server route to the EchoRouter.
func RegisterHandlersWithBaseURL ¶
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.
Types ¶
type Callback ¶
type Callback struct {
// HttpMethod The HTTP method used for the callback request (e.g., POST, GET).
HttpMethod string `json:"httpMethod"`
// RequestBody The body of the callback request.
RequestBody *map[string]interface{} `json:"requestBody,omitempty"`
// Timeout Wait time in milliseconds before the callback request is invoked.
Timeout int `json:"timeout"`
// Url The URL to which the callback request will be sent.
Url string `json:"url"`
}
Callback Defines a callback that will be triggered by the mock server, specifying the HTTP method, request body, URL, and timeout.
type Client ¶
type Client struct {
// The endpoint of the server conforming to this interface, with scheme,
// https://api.deepmap.com for example. This can contain a path relative
// to the server, such as https://api.deepmap.com/dev-test, and all the
// paths in the swagger spec will be appended to the server.
Server string
// Doer for performing requests, typically a *http.Client with any
// customized settings, such as certificate chains.
Client HttpRequestDoer
// A list of callbacks for modifying requests which are generated before sending over
// the network.
RequestEditors []RequestEditorFn
}
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) CreateExpectation ¶
func (c *Client) CreateExpectation(ctx context.Context, body CreateExpectationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) CreateExpectationWithBody ¶
func (*Client) GetExpectations ¶
func (c *Client) GetExpectations(ctx context.Context, params *GetExpectationsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) GetLogs ¶
func (c *Client) GetLogs(ctx context.Context, params *GetLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
type ClientInterface ¶
type ClientInterface interface {
// GetExpectations request
GetExpectations(ctx context.Context, params *GetExpectationsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateExpectationWithBody request with any body
CreateExpectationWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateExpectation(ctx context.Context, body CreateExpectationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetLogs request
GetLogs(ctx context.Context, params *GetLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetRoutes request
GetRoutes(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
}
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) CreateExpectationWithBodyWithResponse ¶
func (c *ClientWithResponses) CreateExpectationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateExpectationResponse, error)
CreateExpectationWithBodyWithResponse request with arbitrary body returning *CreateExpectationResponse
func (*ClientWithResponses) CreateExpectationWithResponse ¶
func (c *ClientWithResponses) CreateExpectationWithResponse(ctx context.Context, body CreateExpectationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateExpectationResponse, error)
func (*ClientWithResponses) GetExpectationsWithResponse ¶
func (c *ClientWithResponses) GetExpectationsWithResponse(ctx context.Context, params *GetExpectationsParams, reqEditors ...RequestEditorFn) (*GetExpectationsResponse, error)
GetExpectationsWithResponse request returning *GetExpectationsResponse
func (*ClientWithResponses) GetLogsWithResponse ¶
func (c *ClientWithResponses) GetLogsWithResponse(ctx context.Context, params *GetLogsParams, reqEditors ...RequestEditorFn) (*GetLogsResponse, error)
GetLogsWithResponse request returning *GetLogsResponse
func (*ClientWithResponses) GetRoutesWithResponse ¶
func (c *ClientWithResponses) GetRoutesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetRoutesResponse, error)
GetRoutesWithResponse request returning *GetRoutesResponse
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// GetExpectationsWithResponse request
GetExpectationsWithResponse(ctx context.Context, params *GetExpectationsParams, reqEditors ...RequestEditorFn) (*GetExpectationsResponse, error)
// CreateExpectationWithBodyWithResponse request with any body
CreateExpectationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateExpectationResponse, error)
CreateExpectationWithResponse(ctx context.Context, body CreateExpectationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateExpectationResponse, error)
// GetLogsWithResponse request
GetLogsWithResponse(ctx context.Context, params *GetLogsParams, reqEditors ...RequestEditorFn) (*GetLogsResponse, error)
// GetRoutesWithResponse request
GetRoutesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetRoutesResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type CreateExpectationJSONRequestBody ¶
type CreateExpectationJSONRequestBody = Expectation
CreateExpectationJSONRequestBody defines body for CreateExpectation for application/json ContentType.
type CreateExpectationResponse ¶
type CreateExpectationResponse struct {
Body []byte
HTTPResponse *http.Response
JSON201 *Expectation
JSON400 *BadRequest
JSON500 *InternalServerError
}
func ParseCreateExpectationResponse ¶
func ParseCreateExpectationResponse(rsp *http.Response) (*CreateExpectationResponse, error)
ParseCreateExpectationResponse parses an HTTP response from a CreateExpectationWithResponse call
func (CreateExpectationResponse) Status ¶
func (r CreateExpectationResponse) Status() string
Status returns HTTPResponse.Status
func (CreateExpectationResponse) StatusCode ¶
func (r CreateExpectationResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type DolusApi ¶
type DolusApi interface {
ServerInterface
}
type DolusApiImpl ¶
type DolusApiImpl struct {
ExpectationEngine engine.ExpectationEngine
Mapper Mapper
}
func NewDolusApi ¶
func NewDolusApi(expectationEngine engine.ExpectationEngine, mapper Mapper, ) *DolusApiImpl
func (*DolusApiImpl) CreateExpectation ¶
func (d *DolusApiImpl) CreateExpectation(ctx echo.Context) error
PostV1DolusExpectations implements server.ServerInterface.
func (*DolusApiImpl) GetExpectations ¶
func (d *DolusApiImpl) GetExpectations(ctx echo.Context, params GetExpectationsParams) error
GetExpectations implements server.ServerInterface.
func (*DolusApiImpl) GetLogs ¶
func (*DolusApiImpl) GetLogs(ctx echo.Context, params GetLogsParams) error
GetV1DolusLogs implements DolusApi.
type EchoRouter ¶
type EchoRouter interface {
CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}
This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration
type ErrorResponseBody ¶
type ErrorResponseBody struct {
// Message message describing error that has occurred
Message string `json:"message"`
}
ErrorResponseBody defines model for ErrorResponseBody.
type Expectation ¶
type Expectation struct {
// Callback Defines a callback that will be triggered by the mock server, specifying the HTTP method, request body, URL, and timeout.
Callback *Callback `json:"callback,omitempty"`
// Priority The priority level of the expectation. Higher values indicate higher priority.
Priority int `json:"priority"`
// Request Details of the request that the mock server should match, including the path, HTTP method, and optional request body.
Request Request `json:"request"`
// Response Details of the response that the mock server should return, including the status code and optional response body.
Response Response `json:"response"`
}
Expectation Represents an expectation set in the mock server, including the priority, request details, response details, and optional callback configuration.
type ExpectationTypeParameter ¶
type ExpectationTypeParameter string
ExpectationTypeParameter defines model for ExpectationTypeParameter.
const ( ExpectationTypeParameterCUSTOM ExpectationTypeParameter = "CUSTOM" ExpectationTypeParameterDEFAULT ExpectationTypeParameter = "DEFAULT" )
Defines values for ExpectationTypeParameter.
type Expectations ¶
type Expectations struct {
// Expectations A list of expectation objects.
Expectations []Expectation `json:"expectations"`
}
Expectations A collection of expectations, each defining a request-response pair or callback configuration for the mock server.
type GeneralError ¶
TODO: make this error part of api spec
type GetExpectationsParams ¶
type GetExpectationsParams struct {
// ExpectationType Parameter specifying the type of expectation to return, can be either DEFAULT or CUSTOM.
ExpectationType *GetExpectationsParamsExpectationType `form:"expectationType,omitempty" json:"expectationType,omitempty"`
// Path Path of the expectation to filter by.
Path *PathParameter `form:"path,omitempty" json:"path,omitempty"`
// Method HTTP method of the expectation to filter by.
Method *GetExpectationsParamsMethod `form:"method,omitempty" json:"method,omitempty"`
}
GetExpectationsParams defines parameters for GetExpectations.
type GetExpectationsParamsExpectationType ¶
type GetExpectationsParamsExpectationType string
GetExpectationsParamsExpectationType defines parameters for GetExpectations.
const ( GetExpectationsParamsExpectationTypeCUSTOM GetExpectationsParamsExpectationType = "CUSTOM" GetExpectationsParamsExpectationTypeDEFAULT GetExpectationsParamsExpectationType = "DEFAULT" )
Defines values for GetExpectationsParamsExpectationType.
type GetExpectationsParamsMethod ¶
type GetExpectationsParamsMethod string
GetExpectationsParamsMethod defines parameters for GetExpectations.
const ( GetExpectationsParamsMethodCONNECT GetExpectationsParamsMethod = "CONNECT" GetExpectationsParamsMethodDELETE GetExpectationsParamsMethod = "DELETE" GetExpectationsParamsMethodGET GetExpectationsParamsMethod = "GET" GetExpectationsParamsMethodHEAD GetExpectationsParamsMethod = "HEAD" GetExpectationsParamsMethodOPTIONS GetExpectationsParamsMethod = "OPTIONS" GetExpectationsParamsMethodPATCH GetExpectationsParamsMethod = "PATCH" GetExpectationsParamsMethodPOST GetExpectationsParamsMethod = "POST" GetExpectationsParamsMethodPUT GetExpectationsParamsMethod = "PUT" GetExpectationsParamsMethodTRACE GetExpectationsParamsMethod = "TRACE" )
Defines values for GetExpectationsParamsMethod.
type GetExpectationsResponse ¶
type GetExpectationsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Expectations
JSON400 *BadRequest
JSON500 *InternalServerError
}
func ParseGetExpectationsResponse ¶
func ParseGetExpectationsResponse(rsp *http.Response) (*GetExpectationsResponse, error)
ParseGetExpectationsResponse parses an HTTP response from a GetExpectationsWithResponse call
func (GetExpectationsResponse) Status ¶
func (r GetExpectationsResponse) Status() string
Status returns HTTPResponse.Status
func (GetExpectationsResponse) StatusCode ¶
func (r GetExpectationsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetLogsParams ¶
type GetLogsParams struct {
// Lines number of log lines to return
Lines *int `form:"lines,omitempty" json:"lines,omitempty"`
}
GetLogsParams defines parameters for GetLogs.
type GetLogsResponse ¶
type GetLogsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *BadRequest
JSON500 *InternalServerError
}
func ParseGetLogsResponse ¶
func ParseGetLogsResponse(rsp *http.Response) (*GetLogsResponse, error)
ParseGetLogsResponse parses an HTTP response from a GetLogsWithResponse call
func (GetLogsResponse) Status ¶
func (r GetLogsResponse) Status() string
Status returns HTTPResponse.Status
func (GetLogsResponse) StatusCode ¶
func (r GetLogsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetRoutesResponse ¶
type GetRoutesResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]Route
JSON500 *InternalServerError
}
func ParseGetRoutesResponse ¶
func ParseGetRoutesResponse(rsp *http.Response) (*GetRoutesResponse, error)
ParseGetRoutesResponse parses an HTTP response from a GetRoutesWithResponse call
func (GetRoutesResponse) Status ¶
func (r GetRoutesResponse) Status() string
Status returns HTTPResponse.Status
func (GetRoutesResponse) StatusCode ¶
func (r GetRoutesResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type InternalServerError ¶
type InternalServerError = ErrorResponseBody
InternalServerError defines model for InternalServerError.
type Mapper ¶
type Mapper interface {
MapToApiExpectations(
expectations []expectation.Expectation,
) ([]Expectation, error)
MapToApiExpectation(expectation expectation.Expectation) (*Expectation, error)
MapToExpectation(expectation Expectation) (*expectation.Expectation, error)
}
type MapperImpl ¶
type MapperImpl struct{}
func NewMapper ¶
func NewMapper() *MapperImpl
func (*MapperImpl) MapToApiExpectation ¶
func (mi *MapperImpl) MapToApiExpectation(expct expectation.Expectation) (*Expectation, error)
func (*MapperImpl) MapToApiExpectations ¶
func (mi *MapperImpl) MapToApiExpectations( expectations []expectation.Expectation, ) ([]Expectation, error)
func (*MapperImpl) MapToExpectation ¶
func (mi *MapperImpl) MapToExpectation(expct Expectation) (*expectation.Expectation, error)
type MapperMock ¶
MapperMock is an autogenerated mock type for the Mapper type
func NewMapperMock ¶
func NewMapperMock(t interface {
mock.TestingT
Cleanup(func())
}) *MapperMock
NewMapperMock creates a new instance of MapperMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MapperMock) EXPECT ¶
func (_m *MapperMock) EXPECT() *MapperMock_Expecter
func (*MapperMock) MapToApiExpectation ¶
func (_m *MapperMock) MapToApiExpectation(_a0 expectation.Expectation) (*Expectation, error)
MapToApiExpectation provides a mock function with given fields: _a0
func (*MapperMock) MapToApiExpectations ¶
func (_m *MapperMock) MapToApiExpectations(expectations []expectation.Expectation) ([]Expectation, error)
MapToApiExpectations provides a mock function with given fields: expectations
func (*MapperMock) MapToExpectation ¶
func (_m *MapperMock) MapToExpectation(_a0 Expectation) (*expectation.Expectation, error)
MapToExpectation provides a mock function with given fields: _a0
type MapperMock_Expecter ¶
type MapperMock_Expecter struct {
// contains filtered or unexported fields
}
func (*MapperMock_Expecter) MapToApiExpectation ¶
func (_e *MapperMock_Expecter) MapToApiExpectation(_a0 interface{}) *MapperMock_MapToApiExpectation_Call
MapToApiExpectation is a helper method to define mock.On call
- _a0 expectation.Expectation
func (*MapperMock_Expecter) MapToApiExpectations ¶
func (_e *MapperMock_Expecter) MapToApiExpectations(expectations interface{}) *MapperMock_MapToApiExpectations_Call
MapToApiExpectations is a helper method to define mock.On call
- expectations []expectation.Expectation
func (*MapperMock_Expecter) MapToExpectation ¶
func (_e *MapperMock_Expecter) MapToExpectation(_a0 interface{}) *MapperMock_MapToExpectation_Call
MapToExpectation is a helper method to define mock.On call
- _a0 Expectation
type MapperMock_MapToApiExpectation_Call ¶
MapperMock_MapToApiExpectation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MapToApiExpectation'
func (*MapperMock_MapToApiExpectation_Call) Return ¶
func (_c *MapperMock_MapToApiExpectation_Call) Return(_a0 *Expectation, _a1 error) *MapperMock_MapToApiExpectation_Call
func (*MapperMock_MapToApiExpectation_Call) Run ¶
func (_c *MapperMock_MapToApiExpectation_Call) Run(run func(_a0 expectation.Expectation)) *MapperMock_MapToApiExpectation_Call
func (*MapperMock_MapToApiExpectation_Call) RunAndReturn ¶
func (_c *MapperMock_MapToApiExpectation_Call) RunAndReturn(run func(expectation.Expectation) (*Expectation, error)) *MapperMock_MapToApiExpectation_Call
type MapperMock_MapToApiExpectations_Call ¶
MapperMock_MapToApiExpectations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MapToApiExpectations'
func (*MapperMock_MapToApiExpectations_Call) Return ¶
func (_c *MapperMock_MapToApiExpectations_Call) Return(_a0 []Expectation, _a1 error) *MapperMock_MapToApiExpectations_Call
func (*MapperMock_MapToApiExpectations_Call) Run ¶
func (_c *MapperMock_MapToApiExpectations_Call) Run(run func(expectations []expectation.Expectation)) *MapperMock_MapToApiExpectations_Call
func (*MapperMock_MapToApiExpectations_Call) RunAndReturn ¶
func (_c *MapperMock_MapToApiExpectations_Call) RunAndReturn(run func([]expectation.Expectation) ([]Expectation, error)) *MapperMock_MapToApiExpectations_Call
type MapperMock_MapToExpectation_Call ¶
MapperMock_MapToExpectation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MapToExpectation'
func (*MapperMock_MapToExpectation_Call) Return ¶
func (_c *MapperMock_MapToExpectation_Call) Return(_a0 *expectation.Expectation, _a1 error) *MapperMock_MapToExpectation_Call
func (*MapperMock_MapToExpectation_Call) Run ¶
func (_c *MapperMock_MapToExpectation_Call) Run(run func(_a0 Expectation)) *MapperMock_MapToExpectation_Call
func (*MapperMock_MapToExpectation_Call) RunAndReturn ¶
func (_c *MapperMock_MapToExpectation_Call) RunAndReturn(run func(Expectation) (*expectation.Expectation, error)) *MapperMock_MapToExpectation_Call
type MethodParameter ¶
type MethodParameter string
MethodParameter defines model for MethodParameter.
const ( MethodParameterCONNECT MethodParameter = "CONNECT" MethodParameterDELETE MethodParameter = "DELETE" MethodParameterGET MethodParameter = "GET" MethodParameterHEAD MethodParameter = "HEAD" MethodParameterOPTIONS MethodParameter = "OPTIONS" MethodParameterPATCH MethodParameter = "PATCH" MethodParameterPOST MethodParameter = "POST" MethodParameterPUT MethodParameter = "PUT" MethodParameterTRACE MethodParameter = "TRACE" )
Defines values for MethodParameter.
type Request ¶
type Request struct {
// Body Optional body of the request.
Body *map[string]interface{} `json:"body,omitempty"`
// Method The HTTP method of the request (e.g., GET, POST).
Method string `json:"method"`
// Path The path of the request to match.
Path string `json:"path"`
}
Request Details of the request that the mock server should match, including the path, HTTP method, and optional request body.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type Response ¶
type Response struct {
// Body Optional body of the response.
Body *map[string]interface{} `json:"body,omitempty"`
// Status The HTTP status code of the response.
Status int `json:"status"`
}
Response Details of the response that the mock server should return, including the status code and optional response body.
type Route ¶
type Route struct {
// Operation The HTTP method of the route (e.g., GET, POST).
Operation string `json:"operation"`
// Path The path of the route.
Path string `json:"path"`
}
Route Represents a route defined in the mock server, including the path and the operation (HTTP method).
type ServerInterface ¶
type ServerInterface interface {
// Retrieve all expectations
// (GET /v1/dolus/expectations)
GetExpectations(ctx echo.Context, params GetExpectationsParams) error
// Create a new expectation
// (POST /v1/dolus/expectations)
CreateExpectation(ctx echo.Context) error
// Retrieve the mock server logs
// (GET /v1/dolus/logs)
GetLogs(ctx echo.Context, params GetLogsParams) error
// Retrieve all mock server routes
// (GET /v1/dolus/routes)
GetRoutes(ctx echo.Context) error
}
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) CreateExpectation ¶
func (w *ServerInterfaceWrapper) CreateExpectation(ctx echo.Context) error
CreateExpectation converts echo context to params.
func (*ServerInterfaceWrapper) GetExpectations ¶
func (w *ServerInterfaceWrapper) GetExpectations(ctx echo.Context) error
GetExpectations converts echo context to params.