Documentation
¶
Index ¶
- func BuildUrl(req *HttpRequest, defaultPDP string, defaultPath string) string
- func Unmarshal(format string, source []byte, target interface{}) error
- type ComparisonOperators
- type ExaminationResult
- type Expectation
- type ExplanationTarget
- type GeneratedSnapshot
- type GenerationPrinter
- type HttpHeader
- type HttpInvoker
- type HttpInvokerOptions
- type HttpRequest
- type HttpResponse
- type Interceptor
- type MeasureBody
- type MeasureBodyField
- type MeasureHeader
- type MeasureHeaders
- type MeasureStatusCode
- type MeasureTotal
- type SpecGenerator
- type SpecHandler
- type SpecHandlerOptions
- type TestCase
- type TestSuite
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ComparisonOperators ¶ added in v1.0.6
type ComparisonOperators struct {
EqualTo interface{} `yaml:"equal-to,omitempty" json:"equal-to"`
NotEqualTo interface{} `yaml:"not-equal-to,omitempty" json:"not-equal-to"`
LT interface{} `yaml:"lt,omitempty" json:"lt"`
LTE interface{} `yaml:"lte,omitempty" json:"lte"`
GT interface{} `yaml:"gt,omitempty" json:"gt"`
GTE interface{} `yaml:"gte,omitempty" json:"gte"`
MemberOf []interface{} `yaml:"member-of,omitempty" json:"member-of"`
NotMemberOf []interface{} `yaml:"not-member-of,omitempty" json:"not-member-of"`
}
type ExaminationResult ¶
type Expectation ¶
type Expectation struct {
StatusCode *MeasureStatusCode `yaml:"status-code,omitempty" json:"status-code"`
Headers *MeasureHeaders `yaml:"headers,omitempty" json:"headers"`
Body *MeasureBody `yaml:"body,omitempty" json:"body"`
}
type ExplanationTarget ¶ added in v1.0.7
type ExplanationTarget interface {
Interceptor
GetConsoleOut() io.Writer
GetConsoleErr() io.Writer
}
type GeneratedSnapshot ¶ added in v1.0.1
type GeneratedSnapshot struct {
TestCases []TestCase `yaml:"testcase-snapshot"`
}
type GenerationPrinter ¶ added in v1.0.7
type GenerationPrinter interface {
Interceptor
GetWriter() io.Writer
}
type HttpHeader ¶
type HttpInvoker ¶
type HttpInvoker struct {
// contains filtered or unexported fields
}
func NewHttpInvoker ¶
func NewHttpInvoker(opts *HttpInvokerOptions) (c *HttpInvoker, err error)
func (*HttpInvoker) Do ¶
func (c *HttpInvoker) Do(req *HttpRequest, interceptors ...Interceptor) (*HttpResponse, error)
type HttpInvokerOptions ¶
type HttpRequest ¶
type HttpRequest struct {
Method string `yaml:"method,omitempty" json:"method"`
Url string `yaml:"url,omitempty" json:"url"`
PDP string `yaml:"pdp,omitempty" json:"pdp"`
Path string `yaml:"path,omitempty" json:"path"`
Headers []HttpHeader `yaml:"headers,omitempty" json:"headers"`
Body string `yaml:"body,omitempty" json:"body"`
}
type HttpResponse ¶
type Interceptor ¶ added in v1.0.1
type Interceptor interface {
}
type MeasureBody ¶
type MeasureBody struct {
HasFormat *string `yaml:"has-format,omitempty" json:"has-format"`
Includes *string `yaml:"includes,omitempty" json:"includes"`
IsEqualTo *string `yaml:"is-equal-to,omitempty" json:"is-equal-to"`
MatchWith *string `yaml:"match-with,omitempty" json:"match-with"`
Fields []MeasureBodyField `yaml:"fields,omitempty" json:"fields"`
}
type MeasureBodyField ¶ added in v1.0.6
type MeasureBodyField struct {
Path *string `yaml:"path,omitempty" json:"path"`
Is *ComparisonOperators `yaml:"is,omitempty" json:"is"`
}
type MeasureHeader ¶
type MeasureHeader struct {
Name *string `yaml:"name" json:"name"`
Is *ComparisonOperators `yaml:"is,omitempty" json:"is"`
}
type MeasureHeaders ¶
type MeasureHeaders struct {
Total *MeasureTotal `yaml:"total,omitempty" json:"total"`
Items []MeasureHeader `yaml:"items,omitempty" json:"items"`
}
type MeasureStatusCode ¶
type MeasureStatusCode struct {
Is *ComparisonOperators `yaml:"is,omitempty" json:"is"`
}
type MeasureTotal ¶ added in v1.0.6
type MeasureTotal struct {
Is *ComparisonOperators `yaml:"is,omitempty" json:"is"`
}
type SpecGenerator ¶ added in v1.0.4
func NewSpecGenerator ¶ added in v1.0.4
func NewSpecGenerator() (*SpecGenerator, error)
type SpecHandler ¶
type SpecHandler struct {
// contains filtered or unexported fields
}
func NewSpecHandler ¶
func NewSpecHandler(opts SpecHandlerOptions) (e *SpecHandler, err error)
func (*SpecHandler) Examine ¶
func (e *SpecHandler) Examine(testcase *TestCase) (*ExaminationResult, error)
type SpecHandlerOptions ¶
type SpecHandlerOptions interface {
}
type TestCase ¶ added in v1.0.3
type TestCase struct {
Title string `yaml:"title" json:"title"`
Version *string `yaml:"version,omitempty" json:"version"`
Request *HttpRequest `yaml:"request" json:"request"`
Expectation *Expectation `yaml:"expectation" json:"expectation"`
Pending *bool `yaml:"pending,omitempty" json:"pending"`
Tags []string `yaml:"tags,omitempty" json:"tags"`
CreatedTime *string `yaml:"created-time,omitempty" json:"created-time"`
}
Click to show internal directories.
Click to hide internal directories.