Documentation ¶
Index ¶
- Variables
- func BindJson(r *http.Request, obj interface{}) error
- func BindQuery(r *http.Request, obj interface{}) error
- func BytesToString(b []byte) string
- func Respond(w http.ResponseWriter, data interface{})
- func RespondError(w http.ResponseWriter, code int)
- func RespondErrorMsg(w http.ResponseWriter, code int, msg string)
- func RespondSuccess(w http.ResponseWriter)
- func StringToBytes(s string) []byte
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Marshal is exported by gin/json package. Marshal = json.Marshal // Unmarshal is exported by gin/json package. Unmarshal = json.Unmarshal // MarshalIndent is exported by gin/json package. MarshalIndent = json.MarshalIndent // NewDecoder is exported by gin/json package. NewDecoder = json.NewDecoder // NewEncoder is exported by gin/json package. NewEncoder = json.NewEncoder )
Functions ¶
func BytesToString ¶
BytesToString converts byte slice to string without a memory allocation.
func Respond ¶
func Respond(w http.ResponseWriter, data interface{})
func RespondError ¶
func RespondError(w http.ResponseWriter, code int)
RespondError return error message
func RespondErrorMsg ¶
func RespondErrorMsg(w http.ResponseWriter, code int, msg string)
func RespondSuccess ¶
func RespondSuccess(w http.ResponseWriter)
func StringToBytes ¶
StringToBytes converts string to byte slice without a memory allocation.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.