ginjsondump

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dump

func Dump() gin.HandlerFunc

func DumpWithOptions

func DumpWithOptions(options Options) gin.HandlerFunc

Types

type DumpData

type DumpData struct {
	Request  DumpRequest
	Response DumpResponse
}

func (*DumpData) ToJSONFormattedString added in v0.1.0

func (d *DumpData) ToJSONFormattedString() string

func (*DumpData) ToJSONString added in v0.0.4

func (d *DumpData) ToJSONString() string

type DumpRequest

type DumpRequest struct {
	Headers http.Header
	Body    map[string]interface{}
	Path    string
	Method  string
	Query   url.Values
}

type DumpResponse

type DumpResponse struct {
	Headers http.Header
	Body    map[string]interface{}
	Status  int
}

type Options

type Options struct {
	// Dump request body
	ShowReqBody bool
	// Dump response body
	ShowRespBody bool
	// Dump request headers
	ShowReqHeaders bool
	// Dump response headers
	ShowRespHeaders bool
	// Dump response status
	ShowRespStatus bool
	// DumpFunc is a function that will be called with the dump data
	DumpFunc func(dumpStr DumpData)
	// Dump request path
	ShowReqPath bool
	// Dump request method
	ShowReqMethod bool
	// Dump request query
	ShowReqQuery bool
}

Jump to

Keyboard shortcuts

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