testhelper

package
v0.0.0-...-389bc3b Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultRouter

func DefaultRouter() *gin.Engine

DefaultRouter return a gin router

func InitTestDatabase

func InitTestDatabase()

InitTestDatabase init test env database

func PerformRequest

func PerformRequest(r http.Handler, method, path string, header http.Header, body ...io.Reader) *httptest.ResponseRecorder

PerformRequest router test

func PerformRequestJSON

func PerformRequestJSON(r http.Handler, method, path string, body io.Reader, header ...http.Header) *httptest.ResponseRecorder

PerformRequestJSON router test

func PerformRequestJSONV2

func PerformRequestJSONV2(r http.Handler, method, path string, data interface{}, header ...http.Header) *httptest.ResponseRecorder

PerformRequestJSONV2 使用interface{} 作为json参数,在函数内部去json Marshal

func StructToMap

func StructToMap(i interface{}) (values url.Values)

StructToMap return url Values for struct or map

Types

This section is empty.

Jump to

Keyboard shortcuts

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