util

package
v0.0.0-...-5c7e32c Latest Latest
Warning

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

Go to latest
Published: May 27, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(req *http.Request, obj interface{}) error

func BindForm

func BindForm(req *http.Request, ptr interface{}) error

func BindJson

func BindJson(req *http.Request, obj interface{}) error

func MD5Encode

func MD5Encode(data string) string

func MakePasswd

func MakePasswd(plainpwd, salt string) string

func Md5Encode

func Md5Encode(data string) string

func Resp

func Resp(writer http.ResponseWriter, code int, data interface{}, message string)

func RespFail

func RespFail(writer http.ResponseWriter, message string)

func RespList

func RespList(w http.ResponseWriter, code int, data interface{}, total interface{})

func RespOk

func RespOk(writer http.ResponseWriter, data interface{}, message string)

func RespOkList

func RespOkList(w http.ResponseWriter, lists interface{}, total interface{})

func ValidatePasswd

func ValidatePasswd(plainpwd, salt, passwd string) bool

Types

type ResponseData

type ResponseData struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"` // omitempty:data 为 null 时,不显示
	Rows    interface{} `json:"rows,omitempty"`
	Total   interface{} `json:"total,omitempty"`
}

Jump to

Keyboard shortcuts

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