Documentation
¶
Index ¶
Constants ¶
View Source
const (
URL = "https://" + addr
)
Variables ¶
This section is empty.
Functions ¶
func SetTransportProxy ¶
func SetTransportProxy() error
SetTransportProxy changes http.DefaultTransport to the one that uses current server as a proxy
Types ¶
type Options ¶
type Options struct {
// Error is a trigger to fail with http.Error
Error bool
// ErrorText is an argument for http.Error in the case of Error == true
ErrorText string
// Code is a status code returned in response
Code int
// Delay represents the amount of time that handler will wait before response
Delay time.Duration
// FailEachNthRequest defines the period of requests failure
FailEachNthRequest int
// FailEachNthCode defines the status code to be returned during periodical requests failure
FailEachNthCode int
// FailThreshold defines the threshold of successfully processed requests, after which mocked responses will be returned
FailThreshold int
// FailThresholdCode defines the status code to be returned after threshold overcome
FailThresholdCode int
// pemPath and keyPath are paths to certs that required by https server
PemPath string
KeyPath string
}
Options represents the amount of options for mock ups
type Proxy ¶
type Proxy struct {
// FailEachNthRequestCounter is a counter required for failing condition on each nth request
FailEachNthRequestCounter int
// FailThresholdCounter is a counter required for failing condition after threshold has been reached
FailThresholdCounter int
// contains filtered or unexported fields
}
Proxy is a struct of proxy wrapper
Click to show internal directories.
Click to hide internal directories.