matching

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2016 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRequestFingerprint

func GetRequestFingerprint(req *http.Request, requestBody []byte, webserver bool) string

getRequestFingerprint returns request hash

Types

type MatchingError

type MatchingError struct {
	StatusCode  int
	Description string
}

func (MatchingError) Error

func (this MatchingError) Error() string

type RequestMatcher

type RequestMatcher struct {
	RequestCache  cache.Cache
	TemplateStore RequestTemplateStore
	Webserver     *bool
}

func (*RequestMatcher) GetResponse

getResponse returns stored response from cache

func (*RequestMatcher) SaveRequestResponsePair added in v0.8.1

func (this *RequestMatcher) SaveRequestResponsePair(pair *models.RequestResponsePair) error

type RequestTemplate

type RequestTemplate struct {
	Path        *string             `json:"path"`
	Method      *string             `json:"method"`
	Destination *string             `json:"destination"`
	Scheme      *string             `json:"scheme"`
	Query       *string             `json:"query"`
	Body        *string             `json:"body"`
	Headers     map[string][]string `json:"headers"`
}

type RequestTemplateResponsePair added in v0.8.1

type RequestTemplateResponsePair struct {
	RequestTemplate RequestTemplate        `json:"requestTemplate"`
	Response        models.ResponseDetails `json:"response"`
}

func ConvertToRequestTemplateResponsePair added in v0.9.0

func ConvertToRequestTemplateResponsePair(pairView v1.RequestTemplateResponsePairView) RequestTemplateResponsePair

func (*RequestTemplateResponsePair) ConvertToRequestResponsePairView added in v0.8.1

func (this *RequestTemplateResponsePair) ConvertToRequestResponsePairView() v2.RequestResponsePairView

func (*RequestTemplateResponsePair) ConvertToRequestTemplateResponsePairView added in v0.8.1

func (this *RequestTemplateResponsePair) ConvertToRequestTemplateResponsePairView() v1.RequestTemplateResponsePairView

func (*RequestTemplateResponsePair) ConvertToV1RequestResponsePairView added in v0.9.0

func (this *RequestTemplateResponsePair) ConvertToV1RequestResponsePairView() v1.RequestResponsePairView

DEPRICATED - Once we remove the v1 API, this will also go

type RequestTemplateStore

type RequestTemplateStore []RequestTemplateResponsePair

func ConvertPayloadToRequestTemplateStore added in v0.9.0

func ConvertPayloadToRequestTemplateStore(payload v1.RequestTemplateResponsePairPayload) RequestTemplateStore

func (RequestTemplateStore) GetPayload added in v0.8.1

func (*RequestTemplateStore) GetResponse

func (this *RequestTemplateStore) GetResponse(req models.RequestDetails, webserver bool) (*models.ResponseDetails, error)

func (*RequestTemplateStore) ImportPayloads

func (this *RequestTemplateStore) ImportPayloads(pairPayload v1.RequestTemplateResponsePairPayload) error

ImportPayloads - a function to save given payloads into the database.

func (*RequestTemplateStore) Wipe

func (this *RequestTemplateStore) Wipe()

Jump to

Keyboard shortcuts

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