Documentation ¶
Index ¶
- Constants
- func BoolEnv(key string) (bool, error)
- func IntEnv(key string) (int, error)
- func ParseStringToFloat64(str string, def float64) float64
- func ParseStringToInt(str string, def int) int
- func StringEnv(key string) (string, error)
- func Stringify(str interface{}) string
- type JSend
- type Links
- type Meta
Constants ¶
View Source
const ( // RequestID Incoming request id RequestID = "request_id" // Bearer Bearer = "Bearer" // XRequestID HTTP request header key X-Request-ID XRequestID = "X-Request-ID" )
Variables ¶
This section is empty.
Functions ¶
func ParseStringToFloat64 ¶
ParseStringToFloat64 Parse string to float64, error return default value
func ParseStringToInt ¶
ParseStringToInt Parse string to int, error return default value
Types ¶
type JSend ¶
type JSend struct { Status string `json:"status"` Message string `json:"message,omitempty"` Data interface{} `json:"data,omitempty"` Meta *Meta `json:"meta,omitempty"` Code string `json:"code,omitempty"` }
JSend used JSend format with some modification
func ErrorResponse ¶ added in v1.7.0
ErrorResponse is used return response with JSON format if failure in server side
func FailResponse ¶
FailResponse is used to return response with JSON format if failure from client side
func SuccessDataResponse ¶
SuccessDataResponse used to return response JSON format if have data value
func SuccessResponse ¶
func SuccessResponse() JSend
SuccessResponse used to return response with JSON format success
Click to show internal directories.
Click to hide internal directories.