Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddHTTPTest ¶
AddHTTPTest appends an HTTPTest to the given slice.
Types ¶
type HTTPTest ¶
type HTTPTest struct { Request *http.Request ExpectedStatus int ExpectedType string Regex *regexp.Regexp ExpectMatch bool Retries, TimeElapse, TimeOut int }
HTTPTest is a request to be tested.
func ImportExcel ¶
func ImportExcel(fileName, tabsToTest *string, logger *VerboseLogger, retries, timeElapse, timeOut int) (r []*HTTPTest)
ImportExcel takes an excel of the correct format and returns a slice of HTTPTest.
func ParseCSV ¶
func ParseCSV(rawCSV *string, logger *VerboseLogger, retries, timeElapse, timeOut int) (r []*HTTPTest)
ParseCSV takes a csv of the correct format and returns a slice of HTTPTest.
func (*HTTPTest) TryRequest ¶
func (h *HTTPTest) TryRequest(ctx context.Context, cancel func(), logger *VerboseLogger, wg *sync.WaitGroup) bool
TryRequest will attempt an HTTP request as many times as specifie and return true if it reaches a successful response.
type VerboseLogger ¶
type VerboseLogger struct{}
VerboseLogger only logs when the verbose variable is true.
func (*VerboseLogger) IsVerbose ¶
func (l *VerboseLogger) IsVerbose() bool
IsVerbose specifies if the logger should log human friendly output. This is nice for a program that has either human friendly verbose output or terse machine friendly return codes.
func (*VerboseLogger) New ¶
func (l *VerboseLogger) New(v *bool)
New creates a new VerboseLogger using the referenced bool to set verbosity.
func (*VerboseLogger) Printf ¶
func (l *VerboseLogger) Printf(s string, v ...interface{})
Printf prints if verbose is true.
func (*VerboseLogger) Println ¶
func (l *VerboseLogger) Println(v ...interface{})
Println prints a line if verbose is true.