http

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownCheckFilter = errors.New("no check filter with the given name is known")
	ErrResponseEmpty      = errors.New("response must not be nil")
)
View Source
var (
	ErrNotAnHTTPInitiator = errors.New("the given initiator is not an HTTP initiator")
)

Functions

func RequestInitiatorForMethod

func RequestInitiatorForMethod(method string) func(logger logging.Logger, params ...rules.Param) (Initiator, error)

Types

type CheckFilterFunc

type CheckFilterFunc func(resp *http.Response) error

func (CheckFilterFunc) Matches

func (c CheckFilterFunc) Matches(resp *http.Response) error

type Initiator

type Initiator interface {
	Do(ctx context.Context, client *http.Client) (resp *http.Response, err error)
}

func InitiatorForRule

func InitiatorForRule(rule *rules.Check, logger logging.Logger) (Initiator, error)

type ValidationChain

type ValidationChain []Validator

func ValidatorsForRule

func ValidatorsForRule(rule *rules.Check) (chain ValidationChain, err error)

func (*ValidationChain) Add

func (c *ValidationChain) Add(v Validator)

func (ValidationChain) Len

func (c ValidationChain) Len() int

func (ValidationChain) Matches

func (c ValidationChain) Matches(resp *http.Response) error

type Validator

type Validator interface {
	Matches(resp *http.Response) error
}

func ResponseBodyContainsFilter

func ResponseBodyContainsFilter(args ...rules.Param) (Validator, error)

func ResponseBodyHashSHA256Filter

func ResponseBodyHashSHA256Filter(args ...rules.Param) (Validator, error)

func ResponseHeaderFilter

func ResponseHeaderFilter(args ...rules.Param) (Validator, error)

func StatusCodeFilter

func StatusCodeFilter(args ...rules.Param) (Validator, error)

Jump to

Keyboard shortcuts

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