logged_client

package
v0.0.0-...-81cac2f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoggedClient

type LoggedClient struct {
	*http.Client
	// contains filtered or unexported fields
}

func NewLoggedClient

func NewLoggedClient(client *http.Client, logger Logger, options Options) *LoggedClient

func (*LoggedClient) Do

func (c *LoggedClient) Do(req *http.Request) (*http.Response, error)

type Logger

type Logger interface {
	Error(msg string, fields map[string]interface{})
	Warning(msg string, fields map[string]interface{})
	Info(msg string, fields map[string]interface{})
}

type Options

type Options struct {
	LogRequestHeaders  bool
	LogRequestBody     bool
	LogResponseHeaders bool
	LogResponseBody    bool
	PrettyJson         bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL