Documentation ¶
Index ¶
Constants ¶
const ( AssuredStatus = "Assured-Status" AssuredMethod = "Assured-Method" AssuredDelay = "Assured-Delay" AssuredCallbackKey = "Assured-Callback-Key" AssuredCallbackTarget = "Assured-Callback-Target" AssuredCallbackDelay = "Assured-Callback-Delay" )
Variables ¶
var DefaultOptions = Options{ // contains filtered or unexported fields }
Functions ¶
This section is empty.
Types ¶
type Call ¶
type Call struct { Path string `json:"path"` Method string `json:"method"` StatusCode int `json:"status_code"` Delay int `json:"delay"` Headers map[string]string `json:"headers"` Query map[string]string `json:"query,omitempty"` Response CallResponse `json:"response,omitempty"` Callbacks []Callback `json:"callbacks,omitempty"` }
Call is a structure containing a request that is stubbed or made
type CallResponse ¶
type CallResponse []byte
CallResponse allows control over the Call's Response encoding
func (*CallResponse) UnmarshalJSON ¶
func (response *CallResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON is a custom implementation for JSON Unmarshalling for the CallResponse Unmarshalling will first check if the data is a local filepath that can be read Else it will check if the data is stringified JSON and un-stringify the data to use or Else it will just use the []byte
type CallStore ¶
func NewCallStore ¶
func NewCallStore() *CallStore
type Callback ¶
type Callback struct { Target string `json:"target"` Method string `json:"method"` Delay int `json:"delay,omitempty"` Headers map[string]string `json:"headers"` Response CallResponse `json:"response,omitempty"` }
Callback is a structure containing a callback that is stubbed
type Client ¶
type Client struct { Options // contains filtered or unexported fields }
Client
func NewClientServe ¶
NewClient creates a new go-rest-assured client and starts serving traffic
func (*Client) Serve ¶
Serve starts the Rest Assured client to begin listening on the application endpoints
type Option ¶
type Option func(*Options)
Option is a function on that configures rest assured settings
func WithCallTracking ¶
WithCallTracking sets the trackMadeCalls option.
func WithHTTPClient ¶
WithHTTPClient sets the http client option.
func WithLogger ¶ added in v4.1.0
WithCallTracking sets the trackMadeCalls option.