Help us shape the future of Go! Take the 2026 Go Developer Survey

dump

package
v3.61.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DumperKey dumperKeyType = iota

Variables

This section is empty.

Functions

func WrapResponseBodyIfNeeded

func WrapResponseBodyIfNeeded(res *http.Response, req *http.Request, dump *Dumper)

Types

type Dumper

type Dumper struct {
	Options
	// contains filtered or unexported fields
}

Dumper is the dump tool.

func GetDumpers

func GetDumpers(ctx context.Context, dump *Dumper) []*Dumper

func NewDumper

func NewDumper(opt Options) *Dumper

NewDumper create a new Dumper.

func (*Dumper) Clone

func (d *Dumper) Clone() *Dumper

func (*Dumper) DumpDefault added in v3.25.0

func (d *Dumper) DumpDefault(p []byte)

func (*Dumper) DumpRequestBody added in v3.25.0

func (d *Dumper) DumpRequestBody(p []byte)

func (*Dumper) DumpRequestHeader added in v3.25.0

func (d *Dumper) DumpRequestHeader(p []byte)

func (*Dumper) DumpResponseBody added in v3.25.0

func (d *Dumper) DumpResponseBody(p []byte)

func (*Dumper) DumpResponseHeader added in v3.25.0

func (d *Dumper) DumpResponseHeader(p []byte)

func (*Dumper) DumpTo added in v3.25.0

func (d *Dumper) DumpTo(p []byte, output io.Writer)

func (*Dumper) SetOptions

func (d *Dumper) SetOptions(opt Options)

func (*Dumper) Start

func (d *Dumper) Start()

func (*Dumper) Stop

func (d *Dumper) Stop()

func (*Dumper) WrapRequestBodyWriteCloser added in v3.25.0

func (d *Dumper) WrapRequestBodyWriteCloser(rc io.WriteCloser) io.WriteCloser

func (*Dumper) WrapRequestBodyWriter added in v3.25.0

func (d *Dumper) WrapRequestBodyWriter(w io.Writer) io.Writer

func (*Dumper) WrapRequestHeaderWriter added in v3.25.0

func (d *Dumper) WrapRequestHeaderWriter(w io.Writer) io.Writer

func (*Dumper) WrapResponseBodyReadCloser added in v3.25.0

func (d *Dumper) WrapResponseBodyReadCloser(rc io.ReadCloser) io.ReadCloser

type Dumpers

type Dumpers []*Dumper

Dumpers is an array of Dumpper

func GetResponseHeaderDumpers

func GetResponseHeaderDumpers(ctx context.Context, dump *Dumper) Dumpers

GetResponseHeaderDumpers return Dumpers which need dump response header.

func (Dumpers) DumpResponseHeader added in v3.25.0

func (ds Dumpers) DumpResponseHeader(p []byte)

func (Dumpers) ShouldDump

func (ds Dumpers) ShouldDump() bool

ShouldDump is true if Dumper is not empty.

type Options

type Options interface {
	Output() io.Writer
	RequestHeaderOutput() io.Writer
	RequestBodyOutput() io.Writer
	ResponseHeaderOutput() io.Writer
	ResponseBodyOutput() io.Writer
	RequestHeader() bool
	RequestBody() bool
	ResponseHeader() bool
	ResponseBody() bool
	Async() bool
	Clone() Options
}

Options controls the dump behavior.

Jump to

Keyboard shortcuts

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