common

package
v0.0.0-...-a757527 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: MIT Imports: 4 Imported by: 0

README

Common

This folder contains common interfaces and structs used across the rest of web-tools

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Renderer

type Renderer interface {
	Render(w http.ResponseWriter, status int, data interface{})
	Error(w http.ResponseWriter, status int, message string)
	InternalError(w http.ResponseWriter)
}

Renderer renders HTTP responses

func NewHTMLRenderer

func NewHTMLRenderer(renderTemplate, errorTemplate *template.Template) Renderer

NewHTMLRenderer makes a renderer that speaks HTML

func NewJSONRenderer

func NewJSONRenderer() Renderer

NewJSONRenderer makes a renderer that speaks JSON

Jump to

Keyboard shortcuts

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