Documentation ¶
Index ¶
- Constants
- func ErrorResponse(req *http.Request, err error, msg string) *http.Response
- func GetRequestLogFields(request *models.RequestDetails) *logrus.Fields
- func GetResponseLogFields(response *models.ResponseDetails) *logrus.Fields
- func ReconstructRequest(pair models.RequestResponsePair) (*http.Request, error)
- func ReconstructResponse(request *http.Request, pair models.RequestResponsePair) *http.Response
- func ReturnErrorAndLog(request *http.Request, err error, pair *models.RequestResponsePair, ...) (*http.Response, error)
- type CaptureMode
- type Hoverfly
- type HoverflyCapture
- type HoverflyModify
- type HoverflySimulate
- type HoverflySynthesize
- type Mode
- type ModeArguments
- type ModifyMode
- type SimulateMode
- type SynthesizeMode
Constants ¶
View Source
const Capture = "capture"
CaptureMode - requests are captured and stored in cache
View Source
const Modify = "modify"
ModifyMode - middleware is applied to outgoing and incoming traffic
View Source
const Simulate = "simulate"
SimulateMode - default mode when Hoverfly looks for captured requests to respond
View Source
const Synthesize = "synthesize"
SynthesizeMode - all requests are sent to middleware to create response
Variables ¶
This section is empty.
Functions ¶
func GetRequestLogFields ¶
func GetRequestLogFields(request *models.RequestDetails) *logrus.Fields
func GetResponseLogFields ¶
func GetResponseLogFields(response *models.ResponseDetails) *logrus.Fields
func ReconstructRequest ¶
func ReconstructRequest(pair models.RequestResponsePair) (*http.Request, error)
ReconstructRequest replaces original request with details provided in Constructor Payload.Request
func ReconstructResponse ¶
ReconstructResponse changes original response with details provided in Constructor Payload.Response
Types ¶
type CaptureMode ¶
type CaptureMode struct { Hoverfly HoverflyCapture Arguments ModeArguments }
func (CaptureMode) Process ¶
func (this CaptureMode) Process(request *http.Request, details models.RequestDetails) (*http.Response, error)
func (*CaptureMode) SetArguments ¶ added in v0.11.0
func (this *CaptureMode) SetArguments(arguments ModeArguments)
type Hoverfly ¶
type Hoverfly interface { GetResponse(models.RequestDetails) (*models.ResponseDetails, *matching.MatchingError) ApplyMiddleware(models.RequestResponsePair) (models.RequestResponsePair, error) DoRequest(*http.Request) (*http.Response, error) IsMiddlewareSet() bool Save(*models.RequestDetails, *models.ResponseDetails) }
type HoverflyCapture ¶
type HoverflyCapture interface { ApplyMiddleware(models.RequestResponsePair) (models.RequestResponsePair, error) DoRequest(*http.Request) (*http.Response, error) Save(*models.RequestDetails, *models.ResponseDetails, []string) error }
type HoverflyModify ¶
type HoverflyModify interface { ApplyMiddleware(models.RequestResponsePair) (models.RequestResponsePair, error) DoRequest(*http.Request) (*http.Response, error) }
type HoverflySimulate ¶
type HoverflySimulate interface { GetResponse(models.RequestDetails) (*models.ResponseDetails, *matching.MatchingError) ApplyMiddleware(models.RequestResponsePair) (models.RequestResponsePair, error) }
type HoverflySynthesize ¶
type HoverflySynthesize interface { ApplyMiddleware(models.RequestResponsePair) (models.RequestResponsePair, error) IsMiddlewareSet() bool }
type Mode ¶
type Mode interface { Process(*http.Request, models.RequestDetails) (*http.Response, error) SetArguments(arguments ModeArguments) }
type ModeArguments ¶ added in v0.11.0
type ModeArguments struct {
Headers []string
}
type ModifyMode ¶
type ModifyMode struct {
Hoverfly HoverflyModify
}
func (ModifyMode) Process ¶
func (this ModifyMode) Process(request *http.Request, details models.RequestDetails) (*http.Response, error)
func (*ModifyMode) SetArguments ¶ added in v0.11.0
func (this *ModifyMode) SetArguments(arguments ModeArguments)
type SimulateMode ¶
type SimulateMode struct {
Hoverfly HoverflySimulate
}
func (SimulateMode) Process ¶
func (this SimulateMode) Process(request *http.Request, details models.RequestDetails) (*http.Response, error)
func (*SimulateMode) SetArguments ¶ added in v0.11.0
func (this *SimulateMode) SetArguments(arguments ModeArguments)
type SynthesizeMode ¶
type SynthesizeMode struct {
Hoverfly HoverflySynthesize
}
func (SynthesizeMode) Process ¶
func (this SynthesizeMode) Process(request *http.Request, details models.RequestDetails) (*http.Response, error)
func (*SynthesizeMode) SetArguments ¶ added in v0.11.0
func (this *SynthesizeMode) SetArguments(arguments ModeArguments)
Click to show internal directories.
Click to hide internal directories.