test

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(t *testing.T, req *Request, method, urlStr string)

func Get

func Get(t *testing.T, req *Request, urlStr string)

func Init

func Init(c *gins.Config)

Init 初始化

func Post

func Post(t *testing.T, req *Request, urlStr string)

Types

type Request

type Request struct {
	// contains filtered or unexported fields
}

func NewRequest

func NewRequest() *Request

func (*Request) AddJSON

func (req *Request) AddJSON(key string, val any)

func (*Request) AddQuery

func (req *Request) AddQuery(key, val string)

func (*Request) SetHeader

func (req *Request) SetHeader(key, val string)

type Response

type Response struct {
	Code constant.APICodeType `json:"code"`
	Msg  string               `json:"msg"`
	Data any                  `json:"data"`
	// contains filtered or unexported fields
}

func NewResponse

func NewResponse(body []byte) (res *Response, err error)

Jump to

Keyboard shortcuts

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