controllers

package
v0.0.0-...-07e86f8 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

This is the main interface file which defines the methods of the controller

Index

Constants

This section is empty.

Variables

View Source
var Verbosity func(err error, format string, a ...interface{}) string

Verbosity returns an error string containing sensitive information when debug mode is activated or a more generic error message otherwise

Functions

func Index

func Index(w http.ResponseWriter, r *http.Request)

Index is the starting point of the web server the index page contains references to all the resources needed

Types

type HTTPController

type HTTPController struct {
	// contains filtered or unexported fields
}

func (HTTPController) BadRequest

func (c HTTPController) BadRequest(w http.ResponseWriter, err error, desc string, a ...interface{})

func (HTTPController) Error

func (c HTTPController) Error(w http.ResponseWriter, err error, errorCode int, description string, a ...interface{})

TODO (chaehni): Replace calls to error functions with this generic function. if used throughout, it makes the dedicated error functions obsolete.

func (HTTPController) Error500

func (c HTTPController) Error500(w http.ResponseWriter, err error, desc string, a ...interface{})

func (HTTPController) Forbidden

func (c HTTPController) Forbidden(w http.ResponseWriter, err error, desc string, a ...interface{})

func (HTTPController) JSON

func (c HTTPController) JSON(data interface{}, w http.ResponseWriter, r *http.Request)

func (HTTPController) NotFound

func (c HTTPController) NotFound(w http.ResponseWriter, err error, desc string, a ...interface{})

func (HTTPController) Plain

func (c HTTPController) Plain(data string, w http.ResponseWriter, r *http.Request)

func (HTTPController) Redirect

func (c HTTPController) Redirect(code int, url string, w http.ResponseWriter, r *http.Request)

func (HTTPController) Render

func (c HTTPController) Render(tpl *template.Template, data interface{}, w http.ResponseWriter, r *http.Request)

Directories

Path Synopsis
Package middleware provides a convenient way to chain http handlers.
Package middleware provides a convenient way to chain http handlers.

Jump to

Keyboard shortcuts

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