capture

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultLayout = TextLayout
)

default setting

Functions

This section is empty.

Types

type ConsoleTransport added in v0.0.5

type ConsoleTransport struct {
	Transport http.RoundTripper
	Layout    *Layout
	Printer   interface {
		Printf(fmt string, args ...interface{})
	}
}

func (*ConsoleTransport) HandleError added in v0.0.5

func (ct *ConsoleTransport) HandleError(err error) error

func (*ConsoleTransport) HandleRequest added in v0.0.5

func (ct *ConsoleTransport) HandleRequest(req *http.Request) (style.State, error)

func (*ConsoleTransport) HandleResponse added in v0.0.5

func (ct *ConsoleTransport) HandleResponse(res *http.Response, s style.State) error

func (*ConsoleTransport) RoundTrip added in v0.0.5

func (ct *ConsoleTransport) RoundTrip(req *http.Request) (*http.Response, error)

type Dir

type Dir string

func (Dir) Open

func (d Dir) Open(filename string) (io.WriteCloser, error)

type FileManager added in v0.0.4

type FileManager struct {
	BaseDir Dir

	Counter      *int64
	DisableCount bool

	RecordWriter io.Writer
}

func (*FileManager) FileName added in v0.0.4

func (m *FileManager) FileName(req *http.Request, name string, suffix string, inc int64) string

type HTTPutilDumpRequestFunc added in v0.0.5

type HTTPutilDumpRequestFunc func(req *http.Request, body bool) ([]byte, error)

func (HTTPutilDumpRequestFunc) Extract added in v0.0.5

func (f HTTPutilDumpRequestFunc) Extract(req *http.Request) (style.State, error)

type HTTPutilDumpResponseFunc added in v0.0.5

type HTTPutilDumpResponseFunc func(resp *http.Response, body bool) ([]byte, error)

func (HTTPutilDumpResponseFunc) Extract added in v0.0.5

func (f HTTPutilDumpResponseFunc) Extract(resp *http.Response) (style.State, error)

type JSONDumpRequestFuncWithStyle added in v0.0.5

type JSONDumpRequestFuncWithStyle struct {
	Style func(*http.Request) (style.Info, error)
}

for json output

func (*JSONDumpRequestFuncWithStyle) Extract added in v0.0.5

type JSONDumpResponseFuncWithStyle added in v0.0.5

type JSONDumpResponseFuncWithStyle struct {
	Style func(*http.Response) (style.Info, error)
}

func (*JSONDumpResponseFuncWithStyle) Extract added in v0.0.5

type Layout added in v0.0.5

type Layout struct {
	Request interface {
		Extract(*http.Request) (style.State, error)
	}
	Response interface {
		Extract(*http.Response) (style.State, error)
	}
}

type WriteFileTransport added in v0.0.5

type WriteFileTransport struct {
	Transport http.RoundTripper
	*FileManager
	Layout    *Layout
	GetPrefix func() string // xxx: use t.Name()
}

func (*WriteFileTransport) HandleError added in v0.0.5

func (wt *WriteFileTransport) HandleError(req *http.Request, s style.State, err error) error

func (*WriteFileTransport) HandleRequest added in v0.0.5

func (wt *WriteFileTransport) HandleRequest(req *http.Request) (style.State, error)

func (*WriteFileTransport) HandleResponse added in v0.0.5

func (wt *WriteFileTransport) HandleResponse(res *http.Response, req *http.Request, s style.State) error

func (*WriteFileTransport) RoundTrip added in v0.0.5

func (wt *WriteFileTransport) RoundTrip(req *http.Request) (*http.Response, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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