gintest

package
v0.0.0-...-9d95335 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response struct {
	*httptest.ResponseRecorder
	// contains filtered or unexported fields
}

func Get

func Get(target string, router http.Handler, fns ...VarsFn) *Response

func Post

func Post(target string, router http.Handler, fns ...VarsFn) *Response

func Request

func Request(method, target string, router http.Handler, fns ...VarsFn) *Response

from https://github.com/gin-gonic/gin/issues/1120

func (*Response) Body

func (r *Response) Body() string

func (*Response) StatusCode

func (r *Response) StatusCode() int

type Vars

type Vars struct {
	Body        io.Reader
	ContentType string
	Query       map[string]string
}

type VarsFn

type VarsFn func(r *Vars)

func JSONVar

func JSONVar(s interface{}) VarsFn

func Query

func Query(k, v string) VarsFn

Jump to

Keyboard shortcuts

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