mockable

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2023 License: MIT Imports: 2 Imported by: 4

README

gin-mockable

Interfaces and helpers for writing tests that mock the dependencies controllers have on gin structs.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(fn HandlerFunc) gin.HandlerFunc

Types

type Context

type Context interface {
	Param(key string) string
	HTML(code int, name string, obj interface{})
	String(code int, format string, values ...interface{})
	Query(key string) string
	AbortWithError(code int, err error) *gin.Error
	GetRequest() *http.Request
	SetCookie(name, value string, maxAge int, path, domain string, secure, httpOnly bool)
	Redirect(code int, location string)
}

type HandlerFunc

type HandlerFunc func(Context)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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