httpserver

package
v0.0.0-...-3413bb5 Latest Latest
Warning

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

Go to latest
Published: May 20, 2019 License: MIT Imports: 10 Imported by: 10

Documentation

Index

Constants

View Source
const (
	DefaultOkString = "{\"message\":\"ok\"}"
)

Variables

View Source
var OKMessage = gin.H{"message": "ok"}

Functions

func CLIFlags

func CLIFlags(urlPath string) []cli.Flag

CLIFlags the flags for the default httpserver

func New

func New(c *cli.Context, callback CLIFunc) error

New applies the callback to the gin instance and returns the error from gin

func NewTest

func NewTest(cliFlag cli.Flag, callback CLIFunc) *httptest.ResponseRecorder

NewTest use this to create a new test case with the httpserver and the provided callback into the function. This should only ever be used in tests

Types

type CLIFunc

type CLIFunc func(*cli.Context, *gin.Context)

CLIFunc the func that is parsed down to the httpserver

Jump to

Keyboard shortcuts

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