Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultReqTransformation ¶
DefaultReqTransformation is a transformation that should be used by default if a custom transformation is not provided. If we don't have a header in the CSV file, the transformation expects the data to be in the following order: URL, HTTP method, headers (in JSON format), body. If we do have a header, then it will look for these fields: url, method, headers, and body.
func TransformRequests ¶
func TransformRequests(userUrls []string, input <-chan reqreader.ReqRecord, transformation ReqTransformation) <-chan sender.Request
TransformRequests reads raw request data from the input channel, transforms it into requests using the given transformation and sends it to the output channel.
Types ¶
type ReqTransformation ¶
ReqTransformation is a function that transforms an input record to an HTTP request.
func NewReqTransformation ¶
func NewReqTransformation(script string) (ReqTransformation, error)
NewReqTransformation creates a new transformation from the given JavaScript code. The script must have a function called 'transform' that accepts a user url and a CSV record, and returns an HTTP request.