evaluator

package
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NOT          = "not"
	LESSTHAN     = "less_than"
	GREATERTHAN  = "greater_than"
	EQUALS       = "equals"
	IN           = "in"
	JSONPATH     = "json_path"
	XMLPATH      = "xpath"
	HTMLPATH     = "html_path"
	REGEXP       = "regexp"
	EXISTS       = "exists"
	CONTAINS     = "contains"
	RANGE        = "range"
	EQUALSONFILE = "equals_on_file"
	TIME         = "time"

	MIN = "min"
	MAX = "max"
	AVG = "avg"
	P99 = "p99"
	P98 = "p98"
	P95 = "p95"
	P90 = "p90"
	P80 = "p80"
)

Variables

This section is empty.

Functions

func Eval

func Eval(node ast.Node, env *AssertEnv, receivedMap map[string]interface{}) (interface{}, error)

Types

type ArgumentError

type ArgumentError struct {
	// contains filtered or unexported fields
}

func (ArgumentError) Error

func (nf ArgumentError) Error() string

func (ArgumentError) Unwrap

func (nf ArgumentError) Unwrap() error

type AssertEnv

type AssertEnv struct {
	StatusCode   int64
	ResponseSize int64
	ResponseTime int64 // in ms
	Body         string
	Headers      http.Header
	Variables    map[string]interface{}
	Cookies      map[string]*http.Cookie // cookies sent by the server, name -> cookie

	// For test-wide assertions
	TotalTime     []int64 // in ms
	FailCount     int
	FailCountPerc float64 // should be in range [0,1]
}

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

func (NotFoundError) Error

func (nf NotFoundError) Error() string

func (NotFoundError) Unwrap

func (nf NotFoundError) Unwrap() error

type OperatorError

type OperatorError struct {
	// contains filtered or unexported fields
}

func (OperatorError) Error

func (nf OperatorError) Error() string

func (OperatorError) Unwrap

func (nf OperatorError) Unwrap() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL