tests

package
v0.0.0-...-3b0e19b Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunGetWithHeaders

func RunGetWithHeaders(path string, headers map[string]string, handler RequestFunc, reply ResponseFunc)

func RunGetWithMiddlewares

func RunGetWithMiddlewares(path string, mws []gin.HandlerFunc, handler RequestFunc, reply ResponseFunc)

func RunPostWithMiddlewares

func RunPostWithMiddlewares(path, body string, mws []gin.HandlerFunc, handler RequestFunc, reply ResponseFunc)

func RunRequest

func RunRequest(rc RequestConfig)

func RunSimpleGet

func RunSimpleGet(path string, handler RequestFunc, reply ResponseFunc)

func RunSimplePost

func RunSimplePost(path, body string, handler RequestFunc, reply ResponseFunc)

Types

type RequestConfig

type RequestConfig struct {
	Method      string
	Path        string
	Body        string
	Headers     map[string]string
	Middlewares []gin.HandlerFunc
	Handler     RequestFunc
	Finaliser   ResponseFunc
}

type RequestFunc

type RequestFunc func(*gin.Context)

request handling func type to replace gin.HandlerFunc

type ResponseFunc

type ResponseFunc func(*httptest.ResponseRecorder)

response handling func type

Jump to

Keyboard shortcuts

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