Documentation
¶
Index ¶
- Variables
- func HandleRequests(w io.Writer, cfg *RequestsMetaConfig) (map[string][]ResponseData, error)
- func RenderTLSData(w io.Writer, r *http.Response)
- func TLSVersionName(v uint16) string
- type Host
- type RequestConfig
- type RequestHTTPClient
- func (rc *RequestHTTPClient) SetCACertsPool(caPool *x509.CertPool) (*RequestHTTPClient, error)
- func (rc *RequestHTTPClient) SetClientTimeout(timeout int) (*RequestHTTPClient, error)
- func (rc *RequestHTTPClient) SetInsecureSkipVerify(isInsecure bool) (*RequestHTTPClient, error)
- func (rc *RequestHTTPClient) SetMethod(method string) (*RequestHTTPClient, error)
- func (rc *RequestHTTPClient) SetProxyProtocolHeader(header proxyproto.Header) (*RequestHTTPClient, error)
- func (rc *RequestHTTPClient) SetProxyProtocolV2(enable bool) *RequestHTTPClient
- func (rc *RequestHTTPClient) SetServerName(serverName string) (*RequestHTTPClient, error)
- func (rc *RequestHTTPClient) SetTransportOverride(transportURL string) (*RequestHTTPClient, error)
- type RequestHeader
- type RequestsMetaConfig
- func (r *RequestsMetaConfig) PrintCmd(w io.Writer)
- func (r *RequestsMetaConfig) SetCaPoolFromFile(filePath string, fileReader certinfo.Reader) error
- func (r *RequestsMetaConfig) SetCaPoolFromYAML(s string) error
- func (r *RequestsMetaConfig) SetDebug(b bool) *RequestsMetaConfig
- func (r *RequestsMetaConfig) SetRequests(requests []RequestConfig) *RequestsMetaConfig
- func (r *RequestsMetaConfig) SetVerbose(b bool) *RequestsMetaConfig
- type ResponseData
- type ResponseHeader
- type URI
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMethodNotFound = errors.New("HTTP method not found")
Functions ¶
func HandleRequests ¶
func HandleRequests(w io.Writer, cfg *RequestsMetaConfig) (map[string][]ResponseData, error)
func TLSVersionName ¶
Types ¶
type RequestConfig ¶
type RequestConfig struct {
Name string `mapstructure:"name"`
ClientTimeout int `mapstructure:"clientTimeout"`
UserAgent string `mapstructure:"userAgent"`
TransportOverrideURL string `mapstructure:"transportOverrideUrl"`
EnableProxyProtocolV2 bool `mapstructure:"enableProxyProtocolV2"`
Insecure bool `mapstructure:"insecure"`
RequestDebug bool `mapstructure:"requestDebug"`
RequestHeaders []RequestHeader `mapstructure:"requestHeaders"`
RequestMethod string `mapstructure:"requestMethod"`
RequestBody string `mapstructure:"requestBody"`
ResponseDebug bool `mapstructure:"responseDebug"`
ResponseHeadersFilter []string `mapstructure:"responseHeadersFilter"`
ResponseBodyMatchRegexp string `mapstructure:"responseBodyMatchRegexp"`
PrintResponseBody bool `mapstructure:"printResponseBody"`
PrintResponseHeaders bool `mapstructure:"printResponseHeaders"`
PrintResponseCertificates bool `mapstructure:"printResponseCertificates"`
Hosts []Host `mapstructure:"hosts"`
}
func (*RequestConfig) PrintRequestDebug ¶
func (*RequestConfig) PrintResponseDebug ¶
func (r *RequestConfig) PrintResponseDebug(w io.Writer, resp *http.Response)
func (*RequestConfig) PrintTitle ¶
func (r *RequestConfig) PrintTitle(isVerbose bool)
type RequestHTTPClient ¶
type RequestHTTPClient struct {
// contains filtered or unexported fields
}
func NewHTTPClientFromRequestConfig ¶
func NewHTTPClientFromRequestConfig(r RequestConfig, serverName string, caPool *x509.CertPool) (*RequestHTTPClient, error)
func NewRequestHTTPClient ¶
func NewRequestHTTPClient() *RequestHTTPClient
func (*RequestHTTPClient) SetCACertsPool ¶
func (rc *RequestHTTPClient) SetCACertsPool(caPool *x509.CertPool) (*RequestHTTPClient, error)
func (*RequestHTTPClient) SetClientTimeout ¶
func (rc *RequestHTTPClient) SetClientTimeout(timeout int) (*RequestHTTPClient, error)
func (*RequestHTTPClient) SetInsecureSkipVerify ¶
func (rc *RequestHTTPClient) SetInsecureSkipVerify(isInsecure bool) (*RequestHTTPClient, error)
func (*RequestHTTPClient) SetMethod ¶
func (rc *RequestHTTPClient) SetMethod(method string) (*RequestHTTPClient, error)
func (*RequestHTTPClient) SetProxyProtocolHeader ¶
func (rc *RequestHTTPClient) SetProxyProtocolHeader(header proxyproto.Header) (*RequestHTTPClient, error)
func (*RequestHTTPClient) SetProxyProtocolV2 ¶
func (rc *RequestHTTPClient) SetProxyProtocolV2(enable bool) *RequestHTTPClient
func (*RequestHTTPClient) SetServerName ¶
func (rc *RequestHTTPClient) SetServerName(serverName string) (*RequestHTTPClient, error)
func (*RequestHTTPClient) SetTransportOverride ¶
func (rc *RequestHTTPClient) SetTransportOverride(transportURL string) (*RequestHTTPClient, error)
type RequestHeader ¶
type RequestsMetaConfig ¶
type RequestsMetaConfig struct {
// TODO: can we remove the following
// three lines and just embed an "options"
// struct to take care of metadata?
RequestDebug bool
RequestVerbose bool
CACertsPool *x509.CertPool
Requests []RequestConfig `mapstructure:"requests"`
}
func NewRequestsMetaConfig ¶
func NewRequestsMetaConfig() (*RequestsMetaConfig, error)
func (*RequestsMetaConfig) PrintCmd ¶
func (r *RequestsMetaConfig) PrintCmd(w io.Writer)
func (*RequestsMetaConfig) SetCaPoolFromFile ¶
func (r *RequestsMetaConfig) SetCaPoolFromFile(filePath string, fileReader certinfo.Reader) error
func (*RequestsMetaConfig) SetCaPoolFromYAML ¶
func (r *RequestsMetaConfig) SetCaPoolFromYAML(s string) error
func (*RequestsMetaConfig) SetDebug ¶
func (r *RequestsMetaConfig) SetDebug(b bool) *RequestsMetaConfig
func (*RequestsMetaConfig) SetRequests ¶
func (r *RequestsMetaConfig) SetRequests(requests []RequestConfig) *RequestsMetaConfig
func (*RequestsMetaConfig) SetVerbose ¶
func (r *RequestsMetaConfig) SetVerbose(b bool) *RequestsMetaConfig
type ResponseData ¶
type ResponseData struct {
Request RequestConfig
TransportAddress string
URL string
ResponseBody string
ResponseBodyRegexpMatched bool
Response *http.Response
Error error
}
func (*ResponseData) ImportResponseBody ¶
func (rd *ResponseData) ImportResponseBody()
func (ResponseData) PrintResponseData ¶
func (rd ResponseData) PrintResponseData(isVerbose bool)
type ResponseHeader ¶
type ResponseHeader string
func (ResponseHeader) String ¶
func (h ResponseHeader) String() string
Click to show internal directories.
Click to hide internal directories.