Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct { Method consts.HttpMethod `json:"method"` Url string `json:"url"` QueryParams []domain.Param `json:"queryParams,omitempty"` PathParams []domain.Param `json:"pathParams,omitempty"` Headers []domain.Param `json:"headers,omitempty"` Cookies []domain.ExecCookie `json:"cookies,omitempty"` Body string `json:"body,omitempty"` FormData []domain.BodyFormDataItem `json:"formData,omitempty"` }
type Response ¶
type Response struct { StatusCode consts.HttpRespCode `json:"statusCode"` ContentType consts.HttpContentType `json:"contentType"` Headers []domain.Param `json:"headers,omitempty"` Data interface{} `json:"data,omitempty"` // used by adv mock UseAdvMock bool `json:"useAdvMock,omitempty"` Content string `json:"content"` DelayTime uint `json:"delayTime,omitempty"` }
type ResponseGenerator ¶
type ResponseGenerator interface {
GenerateResponse(request *http.Request, route *routers.Route, code string) (*Response, error)
}
func New ¶
func New(dataGenerator mockData.MediaGenerator) ResponseGenerator
Click to show internal directories.
Click to hide internal directories.