engine

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func IsZero

func IsZero(v reflect.Value) bool

func RefOfString added in v1.0.1

func RefOfString(val string) *string

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
}

type Expectation

type Expectation struct {
	StatusCode *MeasureStatusCode `yaml:"status-code,omitempty"`
	Headers    *MeasureHeaders    `yaml:"headers,omitempty"`
	Body       *MeasureBody       `yaml:"body,omitempty"`
}

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 {
	Scenarios []Scenario `yaml:"testcase-snapshot"`
}

type HttpHeader

type HttpHeader struct {
	Name  string `yaml:"name"`
	Value string `yaml:"value"`
}

type HttpInvoker

type HttpInvoker struct {
	// contains filtered or unexported fields
}

func NewHttpInvoker

func NewHttpInvoker(opts HttpInvokerOptions) (*HttpInvoker, error)

func (*HttpInvoker) Do

func (c *HttpInvoker) Do(req *HttpRequest, interceptors ...Interceptor) (*HttpResponse, error)

type HttpInvokerOptions

type HttpInvokerOptions interface {
	GetPDP() string
}

type HttpRequest

type HttpRequest struct {
	Method  string       `yaml:"method,omitempty"`
	Url     string       `yaml:"url,omitempty"`
	PDP     string       `yaml:"pdp,omitempty"`
	Path    string       `yaml:"path,omitempty"`
	Headers []HttpHeader `yaml:"headers,omitempty"`
	Body    string       `yaml:"body,omitempty"`
}

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"`
	TextEquals *string `yaml:"text-equal,omitempty"`
	MatchWith  *string `yaml:"match-with,omitempty"`
	JSONEquals *string `yaml:"json-equal,omitempty"`
	JSONCovers *string `yaml:"json-include,omitempty"`
	YAMLEquals *string `yaml:"yaml-equal,omitempty"`
	YAMLCovers *string `yaml:"yaml-include,omitempty"`
}

type MeasureHeader

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

type MeasureHeaders

type MeasureHeaders struct {
	HasTotal *int            `yaml:"has-total,omitempty"`
	Items    []MeasureHeader `yaml:"items,omitempty"`
}

type MeasureStatusCode

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

type Scenario

type Scenario struct {
	Title       string       `yaml:"title"`
	Skipped     *bool        `yaml:"skipped,omitempty"`
	OnError     string       `yaml:"on-error,omitempty"`
	Request     *HttpRequest `yaml:"request"`
	Expectation *Expectation `yaml:"expectation"`
}

type SnapshotGenerator added in v1.0.1

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

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(scenario *Scenario) (*ExaminationResult, error)

type SpecHandlerOptions

type SpecHandlerOptions interface {
}

Jump to

Keyboard shortcuts

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