context

package
v0.0.0-...-61829c1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTestContextBody

func GetTestContextBody(c *gin.Context) []byte

func GetTestContextStatus

func GetTestContextStatus(c *gin.Context) int

func UnmarshalJSONTestContextBody

func UnmarshalJSONTestContextBody(c *gin.Context, resp interface{})

func WithRequest

func WithRequest(opts RequestOpts) *gin.Context

Types

type RequestOpts

type RequestOpts struct {
	FormData map[string]string
	Query    map[string]string
	Params   map[string]string
	Headers  map[string]string
	Context  map[string]interface{}
	Body     interface{}
}

func (RequestOpts) Merge

func (opts RequestOpts) Merge(reqOptions RequestOpts) RequestOpts

type TestResponseWriter

type TestResponseWriter struct {
	http.ResponseWriter
	http.Hijacker
	http.Flusher
	http.CloseNotifier
	Body       bytes.Buffer
	WHeader    http.Header
	HttpStatus int

	CloseNotifyChan <-chan bool
	// contains filtered or unexported fields
}

func (*TestResponseWriter) CloseNotify

func (w *TestResponseWriter) CloseNotify() <-chan bool

func (*TestResponseWriter) Flush

func (w *TestResponseWriter) Flush()

func (*TestResponseWriter) Header

func (w *TestResponseWriter) Header() http.Header

func (*TestResponseWriter) Hijack

func (w *TestResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)

func (*TestResponseWriter) Size

func (w *TestResponseWriter) Size() int

func (*TestResponseWriter) Status

func (w *TestResponseWriter) Status() int

func (*TestResponseWriter) Write

func (w *TestResponseWriter) Write(data []byte) (int, error)

func (*TestResponseWriter) WriteHeader

func (w *TestResponseWriter) WriteHeader(status int)

func (*TestResponseWriter) WriteHeaderNow

func (w *TestResponseWriter) WriteHeaderNow()

func (*TestResponseWriter) WriteString

func (w *TestResponseWriter) WriteString(data string) (int, error)

func (*TestResponseWriter) Written

func (w *TestResponseWriter) Written() bool

Jump to

Keyboard shortcuts

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