http

package
v0.0.0-...-2ba3f65 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package http provides a convenient way to impliment http servers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssetsChain

func AssetsChain(f func(w http.ResponseWriter, r *http.Request)) http.Handler

AssetsChain enables middleware chaining

func Chain

func Chain(f func(w http.ResponseWriter, r *http.Request)) http.Handler

Chain enables middleware chaining

func IsInvalid

func IsInvalid(w http.ResponseWriter, err error, caption string) bool

IsInvalid checks if the second argument represents a real error

func RenderHTML

func RenderHTML(w http.ResponseWriter, templatePath []string, data interface{}, err error)

RenderHTML write data as a HTML text with template

func RenderJSON

func RenderJSON(w http.ResponseWriter, data interface{}, err error)

RenderJSON write data as a json

func RenderText

func RenderText(w http.ResponseWriter, data string, err error)

RenderText write data as a simple text

func RequestGetParam

func RequestGetParam(r *http.Request, key string) (string, bool)

RequestGetParam retrives a request parameter

func RequestGetParamI

func RequestGetParamI(r *http.Request, key string, def int) int

RequestGetParamI retrives a request parameter as int

func RequestGetParamS

func RequestGetParamS(r *http.Request, key, def string) string

RequestGetParamS retrives a request parameter as string

func RequestPostParam

func RequestPostParam(r *http.Request, key string) (string, bool)

RequestPostParam retrives a POST request parameter

func RequestPostParamS

func RequestPostParamS(r *http.Request, key, def string) string

RequestPostParamS retrives a request parameter as string

func SplittedUpperStrings

func SplittedUpperStrings(value string) []string

SplittedUpperStrings split word to array and change those words to UpperCase

Types

This section is empty.

Jump to

Keyboard shortcuts

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