Documentation
¶
Index ¶
Constants ¶
const RunnerID = "HttpRunner"
const ServiceID = "http/runner"
ServiceID represents http runner service id.
const TripData = "Data"
const TripRequests = "Request"
const TripResponses = "Response"
const TripsKey = "httpTrips"
Identifier to access in context
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cookies ¶
Cookies represents cookie
func (*Cookies) AddCookies ¶
AddCookies adds cookies
func (*Cookies) IndexByName ¶
IndexByName index cookie by name
func (*Cookies) IndexByPosition ¶
IndexByPosition index cookie by position
type LoadRequest ¶
type LoadRequest struct {
*SendRequest
ThreadCount int `description:"defines number of http client sending request concurrently, default 3"`
Repeat int `description:"defines how many times repeat individual request, default 1"`
AssertMod int `description:"defines modulo for assertion on repeated request (make sure you have enough memory)"`
Message string `` /* 127-byte string literal not displayed */
}
LoadRequest represents a send http request.
func (*LoadRequest) Init ¶
func (r *LoadRequest) Init() error
func (*LoadRequest) Validate ¶
func (r *LoadRequest) Validate() error
type LoadResponse ¶
type LoadResponse struct {
SendResponse
Status string
Error string
QPS float64
TimeoutCount int
ErrorCount int
StatusCodes map[int]int
TestDurationSec float64
RequestCount int
MinResponseTimeInMs float64
AvgResponseTimeInMs float64
MaxResponseTimeInMs float64
}
LoadRequest represents a stress test response
type Request ¶
type Request struct {
*model.Repeater
When string `description:"criteria to send this request"`
Method string `required:"true" description:"HTTP Method"`
URL string
Header http.Header
Cookies Cookies
Body string
JSONBody interface{} `description:"body JSON representation"`
Replace map[string]string `description:"response body key value pair replacement"`
RequestUdf string `description:"user defined function in context.state key, i,e, json to protobuf"`
ResponseUdf string `description:"user defined function in context.state key, i,e, protobuf to json"`
DataSource string `description:"variable input: response or response.body by default"`
Expect map[string]interface{} `description:"desired http response"`
// contains filtered or unexported fields
}
ServiceRequest represents an http request
func (*Request) Build ¶
func (r *Request) Build(context *endly.Context, sessionCookies Cookies) (*http.Request, bool, error)
Build builds an http.Request
type Response ¶
type Response struct {
//ServiceRequest *ServiceRequest
Code int
Header http.Header
Cookies map[string]*http.Cookie
Body string
JSONBody interface{} `description:"structure data if Body was JSON"`
TimeTakenMs int
Error string
}
Response represents Http response
func (*Response) TransformBodyIfNeeded ¶
func (*Response) UpdateCookies ¶
type SendRequest ¶
type SendRequest struct {
Options map[string]interface{} `` /* 225-byte string literal not displayed */
Requests []*Request
Expect map[string]interface{} `description:"If specified it will validated response as actual"`
// contains filtered or unexported fields
}
SendRequest represents a send http request.
func NewSendRequestFromURL ¶
func NewSendRequestFromURL(URL string) (*SendRequest, error)
NewSendRequestFromURL create new request from URL
type SendResponse ¶
type SendResponse struct {
Responses []*Response
Data data.Map
Assert *validator.AssertResponse
}
SendResponse represnets a send response
func NewSendResponseFromURL ¶
func NewSendResponseFromURL(URL string) (*SendResponse, error)
NewSendRequestFromURL create new request from URL
func (*SendResponse) Expand ¶
func (r *SendResponse) Expand(state data.Map)
Expands expands data ($httpTrips.Data) attribute shared across requests within a group
func (*SendResponse) NewResponse ¶
func (r *SendResponse) NewResponse() *Response
NewResponse creates and appends a response
