helpers

package
v0.0.0-...-0f02880 Latest Latest
Warning

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

Go to latest
Published: May 30, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DateFormat

func DateFormat(t time.Time, format string) string

DateFormat takes a PHP like date func to Go's time format.

func DateParse

func DateParse(dateString, format string) (time.Time, error)

DateParse Date use PHP time format.

func Error

func Error(c *gin.Context)

Error return index.html for react/pushState

func GetBody

func GetBody(c *gin.Context) []byte

GetBody will copy the request body into a struct

func JsonError

func JsonError(c *gin.Context, status int, err error)

JsonError returns a json error with http status code

func JsonRaw

func JsonRaw(c *gin.Context, status int, params interface{})

JsonRaw is a wrapper for the basic api endpoint result

func JsonResp

func JsonResp(c *gin.Context, status int, params gin.H)

JsonResp is a wrapper for the basic api endpoint result

Types

This section is empty.

Jump to

Keyboard shortcuts

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