engine

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_PATH string = `/$`
View Source
const DEFAULT_PDP string = `http://localhost:17779`

Variables

This section is empty.

Functions

func BuildUrl added in v1.0.4

func BuildUrl(req *HttpRequest, defaultPDP string, defaultPath string) string

func IsZero

func IsZero(v reflect.Value) bool

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 HttpHeader struct {
	Name  string `yaml:"name" json:"name"`
	Value string `yaml:"value" json:"value"`
}

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 HttpInvokerOptions struct {
	PDP     string
	Version string
}

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 HttpResponse struct {
	Status        string
	StatusCode    int
	Version       string
	Header        http.Header
	ContentLength int64
	Body          []byte
}

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"`
}

type MeasureHeader

type MeasureHeader struct {
	Name      *string `yaml:"name" json:"name"`
	IsEqualTo *string `yaml:"is-equal-to" json:"is-equal-to"`
}

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 MeasureNumber struct {
	IsEqualTo *int `yaml:"is-equal-to,omitempty" json:"is-equal-to"`
	IsLT      *int `yaml:"is-lt,omitempty" json:"is-lt"`
	IsLTE     *int `yaml:"is-lte,omitempty" json:"is-lte"`
	IsGT      *int `yaml:"is-gt,omitempty" json:"is-gt"`
	IsGTE     *int `yaml:"is-gte,omitempty" json:"is-gte"`
}

type MeasureStatusCode

type MeasureStatusCode struct {
	IsEqualTo *int  `yaml:"is-equal-to,omitempty" json:"is-equal-to"`
	BelongsTo []int `yaml:"belongs-to,omitempty" json:"belongs-to"`
}

type SnapshotGenerator added in v1.0.1

type SnapshotGenerator interface {
	Interceptor
	GetTargetWriter() io.Writer
}

type SpecGenerator added in v1.0.4

type SpecGenerator struct {
	ExcludedHeaders []string
	Version         string
}

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"`
}

type TestSuite added in v1.0.3

type TestSuite struct {
	TestCases []*TestCase `yaml:"testcases" json:"testcases"`
	Skipped   *bool       `yaml:"skipped,omitempty" json:"skipped"`
}

Jump to

Keyboard shortcuts

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