sieve

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SIEVE_TESTCASE_BODY_FIELD_REGEXP = regexp.MustCompile(fmt.Sprintf(SIEVE_TESTCASE_PATTERN_BOUND, `\s*case\[([^\]]*)\]\.Body\[([^\]]*)\]\s*(\:\-([^\}]*))?\s*`))
View Source
var SIEVE_TESTCASE_BODY_REGEXP = regexp.MustCompile(fmt.Sprintf(SIEVE_TESTCASE_PATTERN_BOUND, `\s*case\[([^\]]*)\]\.Body\s*(\:\-([^\}]*))?\s*`))
View Source
var SIEVE_TESTCASE_HEADER_REGEXP = regexp.MustCompile(fmt.Sprintf(SIEVE_TESTCASE_PATTERN_BOUND, `\s*case\[([^\]]*)\]\.Header\[([^\]]*)\]\s*(\:\-([^\}]*))?\s*`))
View Source
var SIEVE_TESTCASE_PATTERN_BOUND = `^(?i)\${{%s}}$`
View Source
var SIEVE_TESTCASE_STATUS_CODE_REGEXP = regexp.MustCompile(fmt.Sprintf(SIEVE_TESTCASE_PATTERN_BOUND, `\s*case\[([^\]]*)\]\.StatusCode\s*(\:\-([^\}]*))?\s*`))
View Source
var SIEVE_TESTCASE_STATUS_REGEXP = regexp.MustCompile(fmt.Sprintf(SIEVE_TESTCASE_PATTERN_BOUND, `\s*case\[([^\]]*)\]\.Status\s*(\:\-([^\}]*))?\s*`))
View Source
var SIEVE_TESTCASE_VAR_EXPRESSION = regexp.MustCompile(`(?i)\${{([^}]*)}}`)

Functions

This section is empty.

Types

type DataType

type DataType int
const (
	RESP_STATUS DataType
	RESP_STATUS_CODE
	RESP_HEADER
	RESP_BODY
	RESP_BODY_FIELD
)

type Query

type Query struct {
	TestID  string
	Attr    DataType
	ItemKey string
	Default string
}

func Parse

func Parse(query string) (*Query, error)

type RestCache

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

func NewRestCache

func NewRestCache() (*RestCache, error)

func (*RestCache) Apply

func (s *RestCache) Apply(req *client.HttpRequest) (r *client.HttpRequest, err error)

func (*RestCache) Evaluate

func (s *RestCache) Evaluate(text string) string

func (*RestCache) EvaluateWithExplanation

func (s *RestCache) EvaluateWithExplanation(text string) (string, []string)

func (*RestCache) Get

func (s *RestCache) Get(testId string) (*RestResult, error)

func (*RestCache) Query

func (s *RestCache) Query(query string) (string, error)

func (*RestCache) Store

func (s *RestCache) Store(testId string, res *client.HttpResponse) (*RestResult, error)

type RestResult

type RestResult struct {
	Status        string
	StatusCode    int
	Header        http.Header
	ContentLength int64
	Body          []byte
	BodyField     map[string]interface{}
}

func NewRestResult

func NewRestResult(lowRes *client.HttpResponse) (*RestResult, error)

Jump to

Keyboard shortcuts

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