Documentation ¶
Index ¶
- func DisaableAutoClean(f *HTTPFile)
- func Execute(file *HTTPFile) string
- func HumanOutput(report *Report, w io.Writer)
- func JSONPathGet(data interface{}, path string) string
- func PlainOutput(report *Report, w io.Writer)
- func ReplaceVariable(text []byte, ve Replacer) []byte
- func ReplaceVariableString(text string, ve Replacer) string
- type Case
- type HTTPFile
- type ListReplacer
- type MapReplacer
- type Opt
- type Replacer
- type Report
- type Stat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisaableAutoClean ¶
func DisaableAutoClean(f *HTTPFile)
DisaableAutoClean disable clear after Exectue
func HumanOutput ¶
HumanOutput is plain output of report
func JSONPathGet ¶
JSONPathGet get a pathed value from data
func PlainOutput ¶
PlainOutput is plain output of report
func ReplaceVariable ¶
ReplaceVariable replace variable placeholder to value
func ReplaceVariableString ¶
ReplaceVariableString replace variable placeholder to value string
Types ¶
type Case ¶
type Case struct { Name string // name of case RespCode int // reponse code RequestSize int // request body length ResponseSize int // resoonse bytes length RespTime time.Duration // response time // contains filtered or unexported fields }
Case is a http request case
type HTTPFile ¶
type HTTPFile struct { Variables map[string]string // variable in this file Cases []*Case // all cases AutoClean bool // automatic release resource, otherwise caller should do Release after use, default is true }
HTTPFile is a .http or .rest file parse result
func ParseBytes ¶
ParseBytes parse httpfile from content
func ParseReader ¶
ParseReader parse httpfile from a reader
type ListReplacer ¶
type ListReplacer []Replacer
ListReplacer is a ValueExtractor based on []ValueExtractor
type MapReplacer ¶
MapReplacer is a ValueExtractor based on map[string]string
type Replacer ¶
type Replacer interface { // Get return the value by key, if not found key, should return "", false Get(key string) (string, bool) }
Replacer transform key to value
type Report ¶
type Report struct { TotalRequests int Currency int Successed int RateLimit int Failed int TotalSend int TotalRecv int RequestTotalTimeUsed float64 ResponseTotalTimeUsed float64 RequestPerSecond int ResponsePerSecond int SendSpeed float64 RecvSpeed float64 AvgTimeUsed float64 MaxTimeUsed float64 MinTimeUsed float64 P50TimeUsed float64 P75TimeUsed float64 P90TimeUsed float64 P95TimeUsed float64 P99TimeUsed float64 Stats []Stat }
Report is the statatics of results
func ReportStat ¶
ReportStat generate report for stats