Documentation
¶
Index ¶
- Constants
- func BuildUrl(req *HttpRequest, defaultPDP string, defaultPath string) string
- func IsZero(v reflect.Value) bool
- type DiffReporter
- type ExaminationResult
- type Expectation
- type ExplanationWriter
- type GeneratedSnapshot
- type HttpHeader
- type HttpInvoker
- type HttpInvokerOptions
- type HttpRequest
- type HttpResponse
- type Interceptor
- type MeasureBody
- type MeasureHeader
- type MeasureHeaders
- type MeasureNumber
- type MeasureStatusCode
- type SnapshotGenerator
- type SpecGenerator
- type SpecHandler
- type SpecHandlerOptions
- type TagManager
- type TagManagerOptions
- type TestCase
- type TestSuite
Constants ¶
View Source
const DEFAULT_PATH string = `/$`
View Source
const DEFAULT_PDP string = `http://localhost:17779`
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DiffReporter ¶
type DiffReporter struct {
// contains filtered or unexported fields
}
func (*DiffReporter) GetDiffs ¶
func (r *DiffReporter) GetDiffs() []string
func (*DiffReporter) HasDiffs ¶
func (r *DiffReporter) HasDiffs() bool
func (*DiffReporter) PopStep ¶
func (r *DiffReporter) PopStep()
func (*DiffReporter) PushStep ¶
func (r *DiffReporter) PushStep(ps cmp.PathStep)
func (*DiffReporter) Report ¶
func (r *DiffReporter) Report(rs cmp.Result)
func (*DiffReporter) String ¶
func (r *DiffReporter) String() string
type ExaminationResult ¶
type ExaminationResult struct {
Errors map[string]error
Response *HttpResponse
Status string
}
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 ExplanationWriter ¶ added in v1.0.1
type ExplanationWriter interface {
Interceptor
GetConsoleOut() io.Writer
GetConsoleErr() io.Writer
}
type GeneratedSnapshot ¶ added in v1.0.1
type GeneratedSnapshot struct {
TestCases []TestCase `yaml:"testcase-snapshot"`
}
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 MeasureHeader ¶
type MeasureHeaders ¶
type MeasureHeaders struct {
Total *MeasureNumber `yaml:"total,omitempty" json:"total"`
Items []MeasureHeader `yaml:"items,omitempty" json:"items"`
}
type MeasureNumber ¶ added in v1.0.4
type MeasureStatusCode ¶
type SnapshotGenerator ¶ added in v1.0.1
type SnapshotGenerator interface {
Interceptor
GetTargetWriter() io.Writer
}
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 TagManager ¶ added in v1.0.5
type TagManager struct {
// contains filtered or unexported fields
}
func NewTagManager ¶ added in v1.0.5
func NewTagManager(opts TagManagerOptions) (ref *TagManager, err error)
func (*TagManager) GetExcludedTags ¶ added in v1.0.5
func (g *TagManager) GetExcludedTags() []string
func (*TagManager) GetIncludedTags ¶ added in v1.0.5
func (g *TagManager) GetIncludedTags() []string
func (*TagManager) Initialize ¶ added in v1.0.5
func (g *TagManager) Initialize(tagexps []string)
func (*TagManager) IsActive ¶ added in v1.0.5
func (g *TagManager) IsActive(tags []string) bool
type TagManagerOptions ¶ added in v1.0.5
type TagManagerOptions interface {
GetConditionalTags() []string
}
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"`
Skipped *bool `yaml:"skipped,omitempty" json:"skipped"`
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.