mocker

package
v0.0.0-...-43e954f Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mocker

type Mocker struct {
	Router *gin.Engine
}

Mocker define router and api to test http server with gin

func Middlewares

func Middlewares(middlewares ...gin.HandlerFunc) *Mocker

Middlewares to mock for gin

func New

func New(router *gin.Engine) *Mocker

New a Mocker instance

func (*Mocker) Mock

func (mocker *Mocker) Mock(req *http.Request, body interface{}) (res *httptest.ResponseRecorder)

Mock gin http test

Jump to

Keyboard shortcuts

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