dumper

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package dumper is a utility package for dumping http request contents

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dumper

type Dumper struct {
	// ResponseWriter is the original response writer
	http.ResponseWriter
	// contains filtered or unexported fields
}

Dumper is a response writer that captures the response body

func NewDumper

func NewDumper(resp *echo.Response) *Dumper

NewDumper returns a new Dumper

func (*Dumper) Flush

func (d *Dumper) Flush()

Flush flushes the response writer if it implements http.Flusher interface and is not nil

func (*Dumper) GetResponse

func (d *Dumper) GetResponse() string

GetResponse returns the response body out of the buffer

func (*Dumper) Hijack

func (d *Dumper) Hijack() (net.Conn, *bufio.ReadWriter, error)

Hijack hijacks the response writer and returns the connection and read writer

func (*Dumper) Write

func (d *Dumper) Write(b []byte) (int, error)

Write writes the response body

Jump to

Keyboard shortcuts

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