Documentation
¶
Overview ¶
Copyright (c) 2015, Marian Kopriva All rights reserved. Licensed under BSD, see LICENSE for details.
Index ¶
Constants ¶
const ( // ANSI color values used to colorize terminal output for better readability. RedColor = "\033[91m" YellowColor = "\033[93m" PurpleColor = "\033[95m" CyanColor = "\033[96m" StopColor = "\033[0m" )
Variables ¶
var ( // Addr is the TCP network address used to construct requests. The user // is free to set it to any other address value they want to test. Addr = "localhost:3456" )
Functions ¶
This section is empty.
Types ¶
type File ¶
The type File should be used in combination with the type MultipartBody to represent a file being uploaded in an http request.
type FormBody ¶
FormBody represents an http request body whose content is of type application/x-www-form-urlencoded.
type Header ¶
Header represents an HTTP Header.
type Hit ¶
type Hit struct { // the endpoint to be tested Path string // the requests to be made to the above specified endpoint Requests Requests }
Hit represents a bunch of test requests against a specific endpoint.
type JSONBody ¶
type JSONBody map[string]interface{}
JSONBody represents an http request body whose content is of type application/json.
func (JSONBody) Body ¶
Body implements the Bodyer interface by marshaling the receiver's contents into a JSON string and returning it as an io.Reader.
type MultipartBody ¶
type MultipartBody map[string][]interface{}
MultipartBody represents an http request body whose content is of type multipart/form-data. The MultipartBody can handle values only of type string or hit's File.
func (MultipartBody) Body ¶
func (b MultipartBody) Body() (io.Reader, error)
Body implements the Bodyer interface by serializing the receiver's contents into a mutlipart data stream and returning it as an io.Reader.
func (MultipartBody) Type ¶
func (MultipartBody) Type() string
Type returns the MultipartBody's media type.
type Response ¶
Response represents a trimmed down HTTP response.
func (Response) CompareStatus ¶
CompareStatus checks if the specified status is equal to the receiver's Status. If they are not equal a formatted error is returned.