Documentation
¶
Overview ¶
Package mockserver exposes a Mockserver services.
Index ¶
Constants ¶
View Source
const (
// ServiceName is the advertised name of this service.
ServiceName = "mockserver"
)
Variables ¶
This section is empty.
Functions ¶
func NewComponent ¶
func NewComponent(opts ...docker.SimpleContainerOptionFunc) *docker.SimpleComponent
NewComponent creates a new Redis component.
Types ¶
type CallTimes ¶
type CallTimes struct {
RemainingTimes int `json:"remainingTimes"`
Unlimited bool `json:"unlimited"`
}
CallTimes configures the call times for an expectation.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for mockserver.
func (*Client) CreateExpectation ¶
func (c *Client) CreateExpectation(expectation Expectation) error
CreateExpectation creates a new expectation (request/response) in the mockserver.
type Expectation ¶
type Expectation struct {
Request Request `json:"httpRequest"`
Response Response `json:"httpResponse"`
Times CallTimes `json:"times"`
}
Expectation represents an expectation in mockserver.
type QueryParameter ¶
QueryParameter is a query parameter for mockserver.
type Request ¶
type Request struct {
Method string `json:"method"`
Path string `json:"path"`
Headers map[string][]string `json:"headers,omitempty"`
QueryParameters []QueryParameter `json:"queryStringParameters,omitempty"`
Body interface{} `json:"body,omitempty"`
}
Request is the request that an expectation matches against.
func (Request) WithJSONBody ¶
WithJSONBody returns a Request with a JSON body set.
Click to show internal directories.
Click to hide internal directories.