httphelpers

package module
v0.0.0-...-823f44c Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatArgs

func FormatArgs(myValue interface{}) string

FormatArgs ****************************************************************** * Transform an argument (no matter the type) to a string for later decryption *****************************************************************************

func GetArg

func GetArg(ps httprouter.Params, argName string, myValue interface{})

GetArg ********************************************************************** * Decrypt the args to the type of myValue and assign it to myValue *****************************************************************************

func RemoveCookie

func RemoveCookie(w *http.ResponseWriter, cookieName, cookieValue string)

***************************************************************************** ** RemoveCookie ** Remove a cookie for the next response. The expiration is set to 1 hour ago ** in order to make it invalid. *****************************************************************************

func Resolve

func Resolve(w http.ResponseWriter, data interface{})

Resolve ********************************************************************* * Send a response to the client *****************************************************************************

func ResolveCookie

func ResolveCookie(w *http.ResponseWriter, cookieName, cookieValue string)

ResolveCookie *************************************************************** * Add a cookie for the next response. Default expiration is 2 months *****************************************************************************

func ResolveWithError

func ResolveWithError(w http.ResponseWriter, err error, status int)

ResolveWithError ************************************************************ * Send an error response to the client *****************************************************************************

func UnFormatArgs

func UnFormatArgs(variable string, myValue interface{})

UnFormatArgs **************************************************************** * Decrypt and argument formated with FormatArgs *****************************************************************************

Types

This section is empty.

Jump to

Keyboard shortcuts

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