Documentation ¶
Index ¶
- type AddHandler
- type CountHandler
- type DelaysHandler
- func (this *DelaysHandler) Delete(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *DelaysHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *DelaysHandler) Put(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *DelaysHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
- type HealthHandler
- type HoverflyCount
- type HoverflyDelays
- type HoverflyMetadata
- type HoverflyMiddleware
- type HoverflyRecords
- type HoverflyState
- type HoverflyStats
- type HoverflyTemplates
- type MessageResponse
- type MetadataHandler
- func (this *MetadataHandler) Delete(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *MetadataHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *MetadataHandler) Put(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *MetadataHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
- type MiddlewareHandler
- type MiddlewareSchema
- type RecordsCount
- type RecordsHandler
- func (this *RecordsHandler) Delete(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *RecordsHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *RecordsHandler) Post(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *RecordsHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
- 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) GetRequestType() *string
- func (this RequestDetailsView) GetScheme() *string
- type RequestResponsePairPayload
- type RequestResponsePairView
- type RequestTemplateResponsePairPayload
- type RequestTemplateResponsePairView
- type RequestTemplateView
- type ResponseDelayPayloadView
- type ResponseDelayView
- type ResponseDetailsView
- type SetMetadata
- type StateHandler
- type StateRequest
- type StatsHandler
- type StatsResponse
- type StoredMetadata
- type TemplatesHandler
- func (this *TemplatesHandler) Delete(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *TemplatesHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *TemplatesHandler) Post(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
- func (this *TemplatesHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddHandler ¶
type AddHandler struct {
Hoverfly HoverflyRecords
}
func (*AddHandler) Post ¶
func (this *AddHandler) Post(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
ManualAddHandler - manually add new request/responses, using a form
func (*AddHandler) RegisterRoutes ¶
func (this *AddHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
type CountHandler ¶
type CountHandler struct {
Hoverfly HoverflyCount
}
func (*CountHandler) Get ¶
func (this *CountHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
RecordsCount returns number of captured requests as a JSON payload
func (*CountHandler) RegisterRoutes ¶
func (this *CountHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
type DelaysHandler ¶
type DelaysHandler struct {
Hoverfly HoverflyDelays
}
func (*DelaysHandler) Delete ¶
func (this *DelaysHandler) Delete(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*DelaysHandler) Get ¶
func (this *DelaysHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*DelaysHandler) Put ¶
func (this *DelaysHandler) Put(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*DelaysHandler) RegisterRoutes ¶
func (this *DelaysHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
type HealthHandler ¶
type HealthHandler struct{}
func (*HealthHandler) Get ¶
func (this *HealthHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*HealthHandler) RegisterRoutes ¶
func (this *HealthHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
type HoverflyCount ¶
type HoverflyDelays ¶
type HoverflyDelays interface { GetResponseDelays() ResponseDelayPayloadView SetResponseDelays(ResponseDelayPayloadView) error DeleteResponseDelays() }
type HoverflyMetadata ¶
type HoverflyMiddleware ¶
type HoverflyRecords ¶
type HoverflyRecords interface { DeleteRequestCache() error GetRecords() ([]RequestResponsePairView, error) ImportRequestResponsePairViews(pairViews []interfaces.RequestResponsePair) error }
type HoverflyState ¶
type HoverflyStats ¶
type HoverflyTemplates ¶
type HoverflyTemplates interface { GetTemplates() RequestTemplateResponsePairPayload ImportTemplates(pairPayload RequestTemplateResponsePairPayload) error DeleteTemplateCache() }
type MessageResponse ¶
type MessageResponse struct {
Message string `json:"message"`
}
func (*MessageResponse) Encode ¶
func (m *MessageResponse) Encode() ([]byte, error)
type MetadataHandler ¶
type MetadataHandler struct {
Hoverfly HoverflyMetadata
}
func (*MetadataHandler) Delete ¶
func (this *MetadataHandler) Delete(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*MetadataHandler) Get ¶
func (this *MetadataHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
AllMetadataHandler returns JSON content type http response
func (*MetadataHandler) Put ¶
func (this *MetadataHandler) Put(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*MetadataHandler) RegisterRoutes ¶
func (this *MetadataHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
type MiddlewareHandler ¶
type MiddlewareHandler struct {
Hoverfly HoverflyMiddleware
}
func (*MiddlewareHandler) Get ¶
func (this *MiddlewareHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*MiddlewareHandler) Post ¶
func (this *MiddlewareHandler) Post(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*MiddlewareHandler) RegisterRoutes ¶
func (this *MiddlewareHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
type MiddlewareSchema ¶
type MiddlewareSchema struct {
Middleware string `json:"middleware"`
}
type RecordsCount ¶
type RecordsCount struct {
Count int `json:"count"`
}
type RecordsHandler ¶
type RecordsHandler struct {
Hoverfly HoverflyRecords
}
func (*RecordsHandler) Delete ¶
func (this *RecordsHandler) Delete(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
DeleteAllRecordsHandler - deletes all captured requests
func (*RecordsHandler) Get ¶
func (this *RecordsHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
AllRecordsHandler returns JSON content type http response
func (*RecordsHandler) Post ¶
func (this *RecordsHandler) Post(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
ImportRecordsHandler - accepts JSON payload and saves it to cache
func (*RecordsHandler) RegisterRoutes ¶
func (this *RecordsHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
type RequestDetailsView ¶
type RequestDetailsView struct { RequestType *string `json:"requestType"` 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.Request
func (RequestDetailsView) GetDestination ¶
func (this RequestDetailsView) GetDestination() *string
Gets Destination - required for interfaces.Request
func (RequestDetailsView) GetHeaders ¶
func (this RequestDetailsView) GetHeaders() map[string][]string
Gets Headers - required for interfaces.Request
func (RequestDetailsView) GetMethod ¶
func (this RequestDetailsView) GetMethod() *string
Gets Method - required for interfaces.Request
func (RequestDetailsView) GetPath ¶
func (this RequestDetailsView) GetPath() *string
Gets Path - required for interfaces.Request
func (RequestDetailsView) GetQuery ¶
func (this RequestDetailsView) GetQuery() *string
Gets Query - required for interfaces.Request
func (RequestDetailsView) GetRequestType ¶
func (this RequestDetailsView) GetRequestType() *string
Gets RequestType - required for interfaces.Request
func (RequestDetailsView) GetScheme ¶
func (this RequestDetailsView) GetScheme() *string
Gets Scheme - required for interfaces.Request
type RequestResponsePairPayload ¶
type RequestResponsePairPayload struct {
Data []RequestResponsePairView `json:"data"`
}
type RequestResponsePairView ¶
type RequestResponsePairView struct { Response ResponseDetailsView `json:"response"` Request RequestDetailsView `json:"request"` }
PayloadView is used when marshalling and unmarshalling payloads.
func (RequestResponsePairView) GetRequest ¶
func (this RequestResponsePairView) GetRequest() interfaces.Request
Gets Request - required for interfaces.RequestResponsePairView
func (RequestResponsePairView) GetResponse ¶
func (this RequestResponsePairView) GetResponse() interfaces.Response
Gets Response - required for interfaces.RequestResponsePairView
type RequestTemplateResponsePairPayload ¶
type RequestTemplateResponsePairPayload struct {
Data *[]RequestTemplateResponsePairView `json:"data"`
}
type RequestTemplateResponsePairView ¶
type RequestTemplateResponsePairView struct { RequestTemplate RequestTemplateView `json:"requestTemplate"` Response ResponseDetailsView `json:"response"` }
type RequestTemplateView ¶
type ResponseDelayPayloadView ¶
type ResponseDelayPayloadView struct {
Data []ResponseDelayView `json:"data"`
}
type ResponseDelayView ¶
type ResponseDetailsView ¶
type ResponseDetailsView struct { Status int `json:"status"` Body string `json:"body"` EncodedBody bool `json:"encodedBody"` Headers map[string][]string `json:"headers"` }
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
type SetMetadata ¶
type StateHandler ¶
type StateHandler struct {
Hoverfly HoverflyState
}
func (*StateHandler) Get ¶
func (this *StateHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
CurrentStateHandler returns current state
func (*StateHandler) Post ¶
func (this *StateHandler) Post(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (*StateHandler) RegisterRoutes ¶
func (this *StateHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
type StateRequest ¶
type StatsHandler ¶
type StatsHandler struct {
Hoverfly HoverflyStats
}
func (*StatsHandler) Get ¶
func (this *StatsHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
StatsHandler - returns current stats about Hoverfly (request counts, record count)
func (*StatsHandler) GetWS ¶
func (this *StatsHandler) GetWS(w http.ResponseWriter, r *http.Request)
StatsWSHandler - returns current stats about Hoverfly (request counts, record count) through the websocket
func (*StatsHandler) RegisterRoutes ¶
func (this *StatsHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)
type StatsResponse ¶
type StoredMetadata ¶
recordedRequests struct encapsulates payload data
type TemplatesHandler ¶
type TemplatesHandler struct {
Hoverfly HoverflyTemplates
}
func (*TemplatesHandler) Delete ¶
func (this *TemplatesHandler) Delete(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
DeleteAllRecordsHandler - deletes all captured requests
func (*TemplatesHandler) Get ¶
func (this *TemplatesHandler) Get(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
AllRecordsHandler returns JSON content type http response
func (*TemplatesHandler) Post ¶
func (this *TemplatesHandler) Post(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
func (*TemplatesHandler) RegisterRoutes ¶
func (this *TemplatesHandler) RegisterRoutes(mux *bone.Mux, am *handlers.AuthHandler)