Documentation ¶
Index ¶
- Variables
- func ValidateSimulation(json, schema map[string]interface{}) error
- type CacheHandler
- func (this *CacheHandler) Delete(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *CacheHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *CacheHandler) Options(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func (this *CacheHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
- type CacheView
- type CachedResponseView
- type ClosestMissView
- type DataViewV1
- type DataViewV2
- type DataViewV3
- type DestinationView
- type GlobalActionsView
- type Hoverfly
- type HoverflyCache
- type HoverflyDestination
- type HoverflyDestinationHandler
- func (this *HoverflyDestinationHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *HoverflyDestinationHandler) Options(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func (this *HoverflyDestinationHandler) Put(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func (this *HoverflyDestinationHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
- type HoverflyHandler
- type HoverflyJournal
- type HoverflyLogs
- type HoverflyMiddleware
- type HoverflyMiddlewareHandler
- func (this *HoverflyMiddlewareHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *HoverflyMiddlewareHandler) Options(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func (this *HoverflyMiddlewareHandler) Put(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *HoverflyMiddlewareHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
- type HoverflyMode
- type HoverflyModeHandler
- func (this *HoverflyModeHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *HoverflyModeHandler) Options(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func (this *HoverflyModeHandler) Put(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func (this *HoverflyModeHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
- type HoverflySimulation
- type HoverflyUpstreamProxy
- type HoverflyUpstreamProxyHandler
- func (this *HoverflyUpstreamProxyHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *HoverflyUpstreamProxyHandler) Options(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func (this *HoverflyUpstreamProxyHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
- type HoverflyUsage
- type HoverflyUsageHandler
- type HoverflyVersion
- type HoverflyVersionHandler
- func (this *HoverflyVersionHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *HoverflyVersionHandler) Options(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func (this *HoverflyVersionHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
- type HoverflyView
- type JournalEntryFilterView
- type JournalEntryView
- type JournalHandler
- func (this *JournalHandler) Delete(response http.ResponseWriter, request *http.Request, next http.HandlerFunc)
- func (this *JournalHandler) Get(response http.ResponseWriter, request *http.Request, next http.HandlerFunc)
- func (this *JournalHandler) Options(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func (this *JournalHandler) Post(response http.ResponseWriter, request *http.Request, next http.HandlerFunc)
- func (this *JournalHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
- type JournalView
- type LogsHandler
- func (this *LogsHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *LogsHandler) GetWS(w http.ResponseWriter, r *http.Request)
- func (this *LogsHandler) Options(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func (this *LogsHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
- type LogsView
- type MetaView
- type MiddlewareView
- type ModeArgumentsView
- type ModeView
- type RequestDetailsView
- func (this RequestDetailsView) GetBody() *string
- func (this RequestDetailsView) GetDestination() *string
- func (this RequestDetailsView) GetHeaders() map[string][]string
- func (this RequestDetailsView) GetMethod() *string
- func (this RequestDetailsView) GetPath() *string
- func (this RequestDetailsView) GetQuery() *string
- func (this RequestDetailsView) GetScheme() *string
- type RequestFieldMatchersView
- type RequestMatcherResponsePairViewV2
- type RequestMatcherResponsePairViewV3
- type RequestMatcherViewV2
- type RequestMatcherViewV3
- type RequestResponsePairViewV1
- type ResponseDetailsView
- type ResponseDetailsViewV3
- type ShutdownHandler
- type SimulationHandler
- func (this *SimulationHandler) Delete(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *SimulationHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *SimulationHandler) GetSchema(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *SimulationHandler) Options(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func (this *SimulationHandler) OptionsSchema(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func (this *SimulationHandler) Put(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *SimulationHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
- type SimulationViewV1
- type SimulationViewV2
- type SimulationViewV3
- type UpstreamProxyView
- type UsageView
- type VersionView
Constants ¶
This section is empty.
Variables ¶
var DefaultLimit = 500
var SimulationViewV1Schema = map[string]interface{}{ "description": "Hoverfly simulation schema", "type": "object", "required": []string{ "data", "meta", }, "additionalProperties": false, "properties": map[string]interface{}{ "data": map[string]interface{}{ "type": "object", "properties": map[string]interface{}{ "pairs": map[string]interface{}{ "type": "array", "items": map[string]interface{}{ "$ref": "#/definitions/request-response-pair", }, }, "globalActions": map[string]interface{}{ "type": "object", "properties": map[string]interface{}{ "delays": map[string]interface{}{ "type": "array", "items": map[string]interface{}{ "$ref": "#/definitions/delay", }, }, }, }, }, }, "meta": map[string]interface{}{ "$ref": "#/definitions/meta", }, }, "definitions": map[string]interface{}{ "request-response-pair": requestResponsePairDefinition, "request": requestV1Definition, "response": responseDefinitionV1, "headers": headersDefinition, "delay": delaysDefinition, "meta": metaDefinition, }, }
var SimulationViewV2Schema = map[string]interface{}{ "description": "Hoverfly simulation schema", "type": "object", "required": []string{ "data", "meta", }, "additionalProperties": false, "properties": map[string]interface{}{ "data": map[string]interface{}{ "type": "object", "properties": map[string]interface{}{ "pairs": map[string]interface{}{ "type": "array", "items": map[string]interface{}{ "$ref": "#/definitions/request-response-pair", }, }, "globalActions": map[string]interface{}{ "type": "object", "properties": map[string]interface{}{ "delays": map[string]interface{}{ "type": "array", "items": map[string]interface{}{ "$ref": "#/definitions/delay", }, }, }, }, }, }, "meta": map[string]interface{}{ "$ref": "#/definitions/meta", }, }, "definitions": map[string]interface{}{ "request-response-pair": requestResponsePairDefinition, "request": requestV3Definition, "response": responseDefinitionV1, "field-matchers": requestFieldMatchersV3Definition, "headers": headersDefinition, "delay": delaysDefinition, "meta": metaDefinition, }, }
var SimulationViewV3Schema = map[string]interface{}{ "description": "Hoverfly simulation schema", "type": "object", "required": []string{ "data", "meta", }, "additionalProperties": false, "properties": map[string]interface{}{ "data": map[string]interface{}{ "type": "object", "properties": map[string]interface{}{ "pairs": map[string]interface{}{ "type": "array", "items": map[string]interface{}{ "$ref": "#/definitions/request-response-pair", }, }, "globalActions": map[string]interface{}{ "type": "object", "properties": map[string]interface{}{ "delays": map[string]interface{}{ "type": "array", "items": map[string]interface{}{ "$ref": "#/definitions/delay", }, }, }, }, }, }, "meta": map[string]interface{}{ "$ref": "#/definitions/meta", }, }, "definitions": map[string]interface{}{ "request-response-pair": requestResponsePairDefinition, "request": requestV3Definition, "response": responseDefinitionV3, "field-matchers": requestFieldMatchersV3Definition, "headers": headersDefinition, "delay": delaysDefinition, "meta": metaDefinition, }, }
Functions ¶
func ValidateSimulation ¶ added in v0.11.0
Types ¶
type CacheHandler ¶ added in v0.11.0
type CacheHandler struct {
Hoverfly HoverflyCache
}
func (*CacheHandler) Delete ¶ added in v0.11.0
func (this *CacheHandler) Delete(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*CacheHandler) Get ¶ added in v0.11.0
func (this *CacheHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*CacheHandler) Options ¶ added in v0.12.0
func (this *CacheHandler) Options(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (*CacheHandler) RegisterRoutes ¶ added in v0.11.0
func (this *CacheHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
type CacheView ¶ added in v0.11.0
type CacheView struct {
Cache []CachedResponseView `json:"cache"`
}
type CachedResponseView ¶ added in v0.11.0
type CachedResponseView struct { Key string `json:"key"` MatchingPair *RequestMatcherResponsePairViewV3 `json:"matchingPair,omitempty"` HeaderMatch bool `json:"headerMatch"` ClosestMiss *ClosestMissView `json:"closestMiss"` }
type ClosestMissView ¶ added in v0.12.0
type ClosestMissView struct { Response ResponseDetailsViewV3 `json:"response"` RequestMatcher RequestMatcherViewV3 `json:"requestMatcher"` MissedFields []string `json:"missedFields"` }
type DataViewV1 ¶ added in v0.11.0
type DataViewV1 struct { RequestResponsePairViewV1 []RequestResponsePairViewV1 `json:"pairs"` GlobalActions GlobalActionsView `json:"globalActions"` }
type DataViewV2 ¶ added in v0.11.0
type DataViewV2 struct { RequestResponsePairs []RequestMatcherResponsePairViewV2 `json:"pairs"` GlobalActions GlobalActionsView `json:"globalActions"` }
type DataViewV3 ¶ added in v0.13.0
type DataViewV3 struct { RequestResponsePairs []RequestMatcherResponsePairViewV3 `json:"pairs"` GlobalActions GlobalActionsView `json:"globalActions"` }
type DestinationView ¶
type DestinationView struct {
Destination string `json:"destination"`
}
type GlobalActionsView ¶
type GlobalActionsView struct {
Delays []v1.ResponseDelayView `json:"delays"`
}
type HoverflyCache ¶ added in v0.11.0
type HoverflyDestination ¶
type HoverflyDestinationHandler ¶
type HoverflyDestinationHandler struct {
Hoverfly HoverflyDestination
}
func (*HoverflyDestinationHandler) Get ¶
func (this *HoverflyDestinationHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*HoverflyDestinationHandler) Options ¶ added in v0.12.0
func (this *HoverflyDestinationHandler) Options(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (*HoverflyDestinationHandler) Put ¶
func (this *HoverflyDestinationHandler) Put(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (*HoverflyDestinationHandler) RegisterRoutes ¶
func (this *HoverflyDestinationHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
type HoverflyHandler ¶
type HoverflyHandler struct {
Hoverfly Hoverfly
}
func (*HoverflyHandler) Get ¶
func (this *HoverflyHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*HoverflyHandler) Options ¶ added in v0.12.0
func (this *HoverflyHandler) Options(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (*HoverflyHandler) RegisterRoutes ¶
func (this *HoverflyHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
type HoverflyJournal ¶ added in v0.12.2
type HoverflyJournal interface { GetEntries() ([]JournalEntryView, error) GetFilteredEntries(journalEntryFilterView JournalEntryFilterView) ([]JournalEntryView, error) DeleteEntries() error }
type HoverflyLogs ¶ added in v0.11.0
type HoverflyMiddleware ¶
type HoverflyMiddlewareHandler ¶
type HoverflyMiddlewareHandler struct {
Hoverfly HoverflyMiddleware
}
func (*HoverflyMiddlewareHandler) Get ¶
func (this *HoverflyMiddlewareHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*HoverflyMiddlewareHandler) Options ¶ added in v0.12.0
func (this *HoverflyMiddlewareHandler) Options(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (*HoverflyMiddlewareHandler) Put ¶
func (this *HoverflyMiddlewareHandler) Put(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*HoverflyMiddlewareHandler) RegisterRoutes ¶
func (this *HoverflyMiddlewareHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
type HoverflyMode ¶
type HoverflyModeHandler ¶
type HoverflyModeHandler struct {
Hoverfly HoverflyMode
}
func (*HoverflyModeHandler) Get ¶
func (this *HoverflyModeHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*HoverflyModeHandler) Options ¶ added in v0.12.0
func (this *HoverflyModeHandler) Options(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (*HoverflyModeHandler) Put ¶
func (this *HoverflyModeHandler) Put(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (*HoverflyModeHandler) RegisterRoutes ¶
func (this *HoverflyModeHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
type HoverflySimulation ¶
type HoverflySimulation interface { GetSimulation() (SimulationViewV3, error) PutSimulation(SimulationViewV3) error DeleteSimulation() }
type HoverflyUpstreamProxy ¶ added in v0.10.1
type HoverflyUpstreamProxy interface {
GetUpstreamProxy() string
}
type HoverflyUpstreamProxyHandler ¶ added in v0.10.1
type HoverflyUpstreamProxyHandler struct {
Hoverfly HoverflyUpstreamProxy
}
func (*HoverflyUpstreamProxyHandler) Get ¶ added in v0.10.1
func (this *HoverflyUpstreamProxyHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*HoverflyUpstreamProxyHandler) Options ¶ added in v0.12.0
func (this *HoverflyUpstreamProxyHandler) Options(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (*HoverflyUpstreamProxyHandler) RegisterRoutes ¶ added in v0.10.1
func (this *HoverflyUpstreamProxyHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
type HoverflyUsage ¶
type HoverflyUsageHandler ¶
type HoverflyUsageHandler struct {
Hoverfly HoverflyUsage
}
func (*HoverflyUsageHandler) Get ¶
func (this *HoverflyUsageHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*HoverflyUsageHandler) Options ¶ added in v0.12.0
func (this *HoverflyUsageHandler) Options(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (*HoverflyUsageHandler) RegisterRoutes ¶
func (this *HoverflyUsageHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
type HoverflyVersion ¶ added in v0.10.1
type HoverflyVersion interface {
GetVersion() string
}
type HoverflyVersionHandler ¶ added in v0.10.1
type HoverflyVersionHandler struct {
Hoverfly HoverflyVersion
}
func (*HoverflyVersionHandler) Get ¶ added in v0.10.1
func (this *HoverflyVersionHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*HoverflyVersionHandler) Options ¶ added in v0.12.0
func (this *HoverflyVersionHandler) Options(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (*HoverflyVersionHandler) RegisterRoutes ¶ added in v0.10.1
func (this *HoverflyVersionHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
type HoverflyView ¶
type HoverflyView struct { DestinationView MiddlewareView `json:"middleware"` ModeView UsageView VersionView UpstreamProxyView }
type JournalEntryFilterView ¶ added in v0.12.2
type JournalEntryFilterView struct {
Request *RequestMatcherViewV2 `json:"request"`
}
type JournalEntryView ¶ added in v0.12.2
type JournalEntryView struct { Request RequestDetailsView `json:"request"` Response ResponseDetailsView `json:"response"` Mode string `json:"mode"` TimeStarted string `json:"timeStarted"` Latency time.Duration `json:"latency"` }
type JournalHandler ¶ added in v0.12.2
type JournalHandler struct {
Hoverfly HoverflyJournal
}
func (*JournalHandler) Delete ¶ added in v0.12.2
func (this *JournalHandler) Delete(response http.ResponseWriter, request *http.Request, next http.HandlerFunc)
func (*JournalHandler) Get ¶ added in v0.12.2
func (this *JournalHandler) Get(response http.ResponseWriter, request *http.Request, next http.HandlerFunc)
func (*JournalHandler) Options ¶ added in v0.12.2
func (this *JournalHandler) Options(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (*JournalHandler) Post ¶ added in v0.12.2
func (this *JournalHandler) Post(response http.ResponseWriter, request *http.Request, next http.HandlerFunc)
func (*JournalHandler) RegisterRoutes ¶ added in v0.12.2
func (this *JournalHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
type JournalView ¶ added in v0.12.2
type JournalView struct {
Journal []JournalEntryView `json:"journal"`
}
type LogsHandler ¶ added in v0.11.0
type LogsHandler struct {
Hoverfly HoverflyLogs
}
func (*LogsHandler) Get ¶ added in v0.11.0
func (this *LogsHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*LogsHandler) GetWS ¶ added in v0.11.0
func (this *LogsHandler) GetWS(w http.ResponseWriter, r *http.Request)
func (*LogsHandler) Options ¶ added in v0.12.0
func (this *LogsHandler) Options(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (*LogsHandler) RegisterRoutes ¶ added in v0.11.0
func (this *LogsHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
type LogsView ¶ added in v0.11.0
type LogsView struct {
Logs []map[string]interface{} `json:"logs"`
}
type MetaView ¶
type MetaView struct { SchemaVersion string `json:"schemaVersion"` HoverflyVersion string `json:"hoverflyVersion"` TimeExported string `json:"timeExported"` }
func NewMetaView ¶ added in v0.11.0
type MiddlewareView ¶
type ModeArgumentsView ¶ added in v0.11.0
type ModeView ¶
type ModeView struct { Mode string `json:"mode"` Arguments ModeArgumentsView `json:"arguments,omitempty"` }
type RequestDetailsView ¶
type RequestDetailsView struct { RequestType *string `json:"requestType,omitempty"` 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"` }
RequestDetailsView is used when marshalling and unmarshalling RequestDetails
func (RequestDetailsView) GetBody ¶
func (this RequestDetailsView) GetBody() *string
Gets Body - required for interfaces.RequestMatcher
func (RequestDetailsView) GetDestination ¶
func (this RequestDetailsView) GetDestination() *string
Gets Destination - required for interfaces.RequestMatcher
func (RequestDetailsView) GetHeaders ¶
func (this RequestDetailsView) GetHeaders() map[string][]string
Gets Headers - required for interfaces.RequestMatcher
func (RequestDetailsView) GetMethod ¶
func (this RequestDetailsView) GetMethod() *string
Gets Method - required for interfaces.RequestMatcher
func (RequestDetailsView) GetPath ¶
func (this RequestDetailsView) GetPath() *string
Gets Path - required for interfaces.RequestMatcher
func (RequestDetailsView) GetQuery ¶
func (this RequestDetailsView) GetQuery() *string
Gets Query - required for interfaces.RequestMatcher
func (RequestDetailsView) GetScheme ¶
func (this RequestDetailsView) GetScheme() *string
Gets Scheme - required for interfaces.RequestMatcher
type RequestFieldMatchersView ¶ added in v0.11.0
type RequestFieldMatchersView struct { ExactMatch *string `json:"exactMatch,omitempty"` XmlMatch *string `json:"xmlMatch,omitempty"` XpathMatch *string `json:"xpathMatch,omitempty"` JsonMatch *string `json:"jsonMatch,omitempty"` JsonPathMatch *string `json:"jsonPathMatch,omitempty"` RegexMatch *string `json:"regexMatch,omitempty"` GlobMatch *string `json:"globMatch,omitempty"` }
type RequestMatcherResponsePairViewV2 ¶ added in v0.12.0
type RequestMatcherResponsePairViewV2 struct { Response ResponseDetailsView `json:"response"` RequestMatcher RequestMatcherViewV2 `json:"request"` }
type RequestMatcherResponsePairViewV3 ¶ added in v0.13.0
type RequestMatcherResponsePairViewV3 struct { Response ResponseDetailsViewV3 `json:"response"` RequestMatcher RequestMatcherViewV3 `json:"request"` }
func (RequestMatcherResponsePairViewV3) GetResponse ¶ added in v0.13.0
func (this RequestMatcherResponsePairViewV3) GetResponse() interfaces.Response
Gets Response - required for interfaces.RequestResponsePairView
type RequestMatcherViewV2 ¶ added in v0.12.0
type RequestMatcherViewV2 struct { Path *RequestFieldMatchersView `json:"path,omitempty"` Method *RequestFieldMatchersView `json:"method,omitempty"` Destination *RequestFieldMatchersView `json:"destination,omitempty"` Scheme *RequestFieldMatchersView `json:"scheme,omitempty"` Query *RequestFieldMatchersView `json:"query,omitempty"` Body *RequestFieldMatchersView `json:"body,omitempty"` Headers map[string][]string `json:"headers,omitempty"` }
RequestDetailsView is used when marshalling and unmarshalling RequestDetails
type RequestMatcherViewV3 ¶ added in v0.13.0
type RequestMatcherViewV3 struct { Path *RequestFieldMatchersView `json:"path,omitempty"` Method *RequestFieldMatchersView `json:"method,omitempty"` Destination *RequestFieldMatchersView `json:"destination,omitempty"` Scheme *RequestFieldMatchersView `json:"scheme,omitempty"` Query *RequestFieldMatchersView `json:"query,omitempty"` Body *RequestFieldMatchersView `json:"body,omitempty"` Headers map[string][]string `json:"headers,omitempty"` }
RequestDetailsView is used when marshalling and unmarshalling RequestDetails
type RequestResponsePairViewV1 ¶ added in v0.11.0
type RequestResponsePairViewV1 struct { Response ResponseDetailsView `json:"response"` Request RequestDetailsView `json:"request"` }
func (RequestResponsePairViewV1) GetRequest ¶ added in v0.11.0
func (this RequestResponsePairViewV1) GetRequest() interfaces.Request
Gets RequestMatcher - required for interfaces.RequestResponsePairView
func (RequestResponsePairViewV1) GetResponse ¶ added in v0.11.0
func (this RequestResponsePairViewV1) GetResponse() interfaces.Response
Gets Response - required for interfaces.RequestResponsePairView
type ResponseDetailsView ¶
type ResponseDetailsView struct { Status int `json:"status"` Body string `json:"body"` EncodedBody bool `json:"encodedBody"` Headers map[string][]string `json:"headers,omitempty"` }
ResponseDetailsView is used when marshalling and unmarshalling requests. This struct's Body may be Base64 encoded based on the EncodedBody field.
func (ResponseDetailsView) GetBody ¶
func (this ResponseDetailsView) GetBody() string
Gets Body - required for interfaces.Response
func (ResponseDetailsView) GetEncodedBody ¶
func (this ResponseDetailsView) GetEncodedBody() bool
Gets EncodedBody - required for interfaces.Response
func (ResponseDetailsView) GetHeaders ¶
func (this ResponseDetailsView) GetHeaders() map[string][]string
Gets Headers - required for interfaces.Response
func (ResponseDetailsView) GetStatus ¶
func (this ResponseDetailsView) GetStatus() int
Gets Status - required for interfaces.Response
func (ResponseDetailsView) GetTemplated ¶ added in v0.13.0
func (this ResponseDetailsView) GetTemplated() bool
type ResponseDetailsViewV3 ¶ added in v0.13.0
type ResponseDetailsViewV3 struct { Status int `json:"status"` Body string `json:"body"` EncodedBody bool `json:"encodedBody"` Headers map[string][]string `json:"headers,omitempty"` Templated bool `json:"templated"` }
func (ResponseDetailsViewV3) GetBody ¶ added in v0.13.0
func (this ResponseDetailsViewV3) GetBody() string
Gets Body - required for interfaces.Response
func (ResponseDetailsViewV3) GetEncodedBody ¶ added in v0.13.0
func (this ResponseDetailsViewV3) GetEncodedBody() bool
Gets EncodedBody - required for interfaces.Response
func (ResponseDetailsViewV3) GetHeaders ¶ added in v0.13.0
func (this ResponseDetailsViewV3) GetHeaders() map[string][]string
Gets Headers - required for interfaces.Response
func (ResponseDetailsViewV3) GetStatus ¶ added in v0.13.0
func (this ResponseDetailsViewV3) GetStatus() int
Gets Status - required for interfaces.Response
func (ResponseDetailsViewV3) GetTemplated ¶ added in v0.13.0
func (this ResponseDetailsViewV3) GetTemplated() bool
type ShutdownHandler ¶ added in v0.11.5
type ShutdownHandler struct { }
func (*ShutdownHandler) Delete ¶ added in v0.11.5
func (this *ShutdownHandler) Delete(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*ShutdownHandler) Options ¶ added in v0.12.0
func (this *ShutdownHandler) Options(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (*ShutdownHandler) RegisterRoutes ¶ added in v0.11.5
func (this *ShutdownHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
type SimulationHandler ¶
type SimulationHandler struct {
Hoverfly HoverflySimulation
}
func (*SimulationHandler) Delete ¶
func (this *SimulationHandler) Delete(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*SimulationHandler) Get ¶
func (this *SimulationHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*SimulationHandler) GetSchema ¶ added in v0.11.0
func (this *SimulationHandler) GetSchema(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*SimulationHandler) Options ¶ added in v0.12.0
func (this *SimulationHandler) Options(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (*SimulationHandler) OptionsSchema ¶ added in v0.12.0
func (this *SimulationHandler) OptionsSchema(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (*SimulationHandler) Put ¶
func (this *SimulationHandler) Put(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*SimulationHandler) RegisterRoutes ¶
func (this *SimulationHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
type SimulationViewV1 ¶ added in v0.11.0
type SimulationViewV1 struct { DataViewV1 `json:"data"` MetaView `json:"meta"` }
func (SimulationViewV1) Upgrade ¶ added in v0.11.0
func (this SimulationViewV1) Upgrade() SimulationViewV3
type SimulationViewV2 ¶ added in v0.11.0
type SimulationViewV2 struct { DataViewV2 `json:"data"` MetaView `json:"meta"` }
func (SimulationViewV2) Upgrade ¶ added in v0.13.0
func (this SimulationViewV2) Upgrade() SimulationViewV3
type SimulationViewV3 ¶ added in v0.13.0
type SimulationViewV3 struct { DataViewV3 `json:"data"` MetaView `json:"meta"` }
func NewSimulationViewFromResponseBody ¶ added in v0.11.0
func NewSimulationViewFromResponseBody(responseBody []byte) (SimulationViewV3, error)
type UpstreamProxyView ¶ added in v0.10.1
type UpstreamProxyView struct {
UpstreamProxy string `json:"upstream-proxy"`
}
type VersionView ¶ added in v0.10.1
type VersionView struct {
Version string `json:"version"`
}
Source Files ¶
- cache_handler.go
- hoverfly_destination_handler.go
- hoverfly_handler.go
- hoverfly_middleware_handler.go
- hoverfly_mode_handler.go
- hoverfly_upstream_proxy_handler..go
- hoverfly_usage_handler.go
- hoverfly_version_handler.go
- journal_handler.go
- logs_handler.go
- shutdown_handler.go
- simulation_handler.go
- simulation_views.go
- simulation_views_v1.go
- simulation_views_v2.go
- simulation_views_v3.go
- simulation_views_validation.go
- testutils.go
- views.go