matching

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2016 License: Apache-2.0 Imports: 9 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) SavePayload

func (this *RequestMatcher) SavePayload(payload *models.Payload) 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 RequestTemplatePayload

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

func (*RequestTemplatePayload) ConvertToRequestTemplatePayloadView

func (this *RequestTemplatePayload) ConvertToRequestTemplatePayloadView() RequestTemplatePayloadView

type RequestTemplatePayloadJson

type RequestTemplatePayloadJson struct {
	Data *[]RequestTemplatePayloadView `json:"data"`
}

func (*RequestTemplatePayloadJson) ConvertToRequestTemplateStore

func (this *RequestTemplatePayloadJson) ConvertToRequestTemplateStore() RequestTemplateStore

type RequestTemplatePayloadView

type RequestTemplatePayloadView struct {
	RequestTemplate RequestTemplate           `json:"requestTemplate"`
	Response        views.ResponseDetailsView `json:"response"`
}

func (*RequestTemplatePayloadView) ConvertToPayload

func (this *RequestTemplatePayloadView) ConvertToPayload() RequestTemplatePayload

type RequestTemplateStore

type RequestTemplateStore []RequestTemplatePayload

func (*RequestTemplateStore) ConvertToPayloadJson

func (this *RequestTemplateStore) ConvertToPayloadJson() RequestTemplatePayloadJson

func (*RequestTemplateStore) GetResponse

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

func (*RequestTemplateStore) ImportPayloads

func (this *RequestTemplateStore) ImportPayloads(payloadsView RequestTemplatePayloadJson) 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