Documentation ¶
Index ¶
- func ContextWithData(ctx context.Context, data map[string]interface{}) context.Context
- func ContextWithDataID(ctx context.Context, id string, val interface{}) error
- func ContextWithOptionalDataID(ctx context.Context, id string, val interface{}) error
- func DataFromContext(ctx context.Context) map[string]interface{}
- func DataIDFromContext(ctx context.Context, id string) interface{}
- type BodyCustomChecker
- type BodyCustomCheckerFunc
- type BodyEqualChecker
- type BodyJSONChecker
- type BodyJSONQueryEqualChecker
- type BodyJSONQueryExistsChecker
- type BodyJSONQueryRegexMatchChecker
- type Checker
- type DataEqualChecker
- type StatusCodeEqualChecker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithData ¶
func ContextWithDataID ¶
func DataFromContext ¶
func DataIDFromContext ¶
Types ¶
type BodyCustomChecker ¶
type BodyCustomChecker struct {
CheckBody BodyCustomCheckerFunc
}
BodyCustomChecker is used to run a BodyCustomCheckerFunc against the body bytes in the http response
type BodyCustomCheckerFunc ¶
BodyCustomCheckerFunc defines the function used to perform a custom http response body check
type BodyEqualChecker ¶
type BodyEqualChecker struct {
Value string
}
BodyEqualChecker is used to validate the http response body string exactly matches `Value`
type BodyJSONChecker ¶
type BodyJSONChecker struct {
Value interface{}
}
BodyJSONChecker is used to validate http response body can be JSON decoded and is equal to `Value`
type BodyJSONQueryEqualChecker ¶
type BodyJSONQueryEqualChecker struct { Query string Value interface{} NullValue bool DataID string }
BodyJSONQueryEqualChecker queries the http response body JSON using `Query` and ensures the value is equal to `Value`
type BodyJSONQueryExistsChecker ¶
BodyJSONQueryExistsChecker queries the http response body JSON using `Query` and ensures a value exists there
type BodyJSONQueryRegexMatchChecker ¶
type BodyJSONQueryRegexMatchChecker struct { Query string Regexp *regexp.Regexp DataIDs map[int]string }
BodyJSONQueryRegexMatchChecker queries the http response body JSON using `Query` and ensures that it matches the regex pattern in `Regexp`
type DataEqualChecker ¶
type DataEqualChecker struct { DataID string Value interface{} }
DataEqualChecker is used to check whether or not the value stored in the context data is equal to the given value
type StatusCodeEqualChecker ¶
type StatusCodeEqualChecker struct {
Value int
}
StatusCodeEqualChecker is used to validate the status code in the response