Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatJSON ¶
FormatJSON is a default function to pretty-format a JSON body. It will also mask known fields which contain sensitive information.
func GetDefaultSensitiveHeaders ¶
func GetDefaultSensitiveHeaders() []string
GetDefaultSensitiveHeaders returns the default list of headers to be masked
Types ¶
type AuthResult ¶
func OpenStackEC2Auth ¶
func OpenStackEC2Auth(identityClient *gophercloud.ServiceClient, ao *ec2tokens.AuthOptions) (*AuthResult, error)
type ILogger ¶
type ILogger interface { RequestPrintf(format string, args ...interface{}) ResponsePrintf(format string, args ...interface{}) }
ILogger is an interface representing the Logger struct
type NoopLogger ¶
type NoopLogger struct{}
NoopLogger is a default noop logger satisfies the Logger interface
func (NoopLogger) RequestPrintf ¶
func (NoopLogger) RequestPrintf(format string, args ...interface{})
Printf is a default noop method
func (NoopLogger) ResponsePrintf ¶
func (NoopLogger) ResponsePrintf(format string, args ...interface{})
Printf is a default noop method
type RoundTripper ¶
type RoundTripper struct { // Default http.RoundTripper Rt http.RoundTripper // Override request Host (e.g. call locahost, but send example.com HTTP host) Host *string // A custom function to format and mask JSON requests and responses FormatJSON func([]byte) (string, error) // How many times HTTP connection should be retried until giving up MaxRetries int // If Logger is not nil, then RoundTrip method will debug the JSON // requests and responses Logger ILogger // contains filtered or unexported fields }
RoundTripper satisfies the http.RoundTripper interface and is used to customize the default http client RoundTripper
func (*RoundTripper) RoundTrip ¶
RoundTrip performs a round-trip HTTP request and logs relevant information about it.
func (*RoundTripper) SetHeaders ¶
func (rt *RoundTripper) SetHeaders(headers http.Header)
SetHeaders sets request headers to be set (not appended) in all client requests
func (*RoundTripper) SetSensitiveHeaders ¶
func (rt *RoundTripper) SetSensitiveHeaders(headers []string)
SetSensitiveHeaders sets the list of case insensitive headers to be masked in debug log