handler

package
v0.0.0-...-b3ea26e Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleDataBaseError

func HandleDataBaseError(c *gin.Context, err error)

HandleDataBaseError HandleDataBaseError

func HandleJSONError

func HandleJSONError(c *gin.Context, err error)

HandleJSONError HandleJSONError

func HandleParamErrno

func HandleParamErrno(c *gin.Context, err error)

HandleParamErrno HandleParamErrno

func HandleReviewError

func HandleReviewError(c *gin.Context, err error)

HandleReviewError HandleReviewError

func HandleWxLoginError

func HandleWxLoginError(c *gin.Context, err error)

HandleWxLoginError HandleWxLoginError

func SendResponse

func SendResponse(c *gin.Context, err error, data interface{})

SendResponse always return http.StatusOK

func SendResponseS

func SendResponseS(c *gin.Context, err error, data interface{}, status int)

SendResponse always return http.StatusOK

Types

type Response

type Response struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

Response global json struct

type SafeMap

type SafeMap struct {
	sync.RWMutex
	Map map[string]map[string]int
}

SafeMap has a locked field

func NewSafeMap

func NewSafeMap(size int) *SafeMap

NewSafeMap return safemap

func (*SafeMap) WriteMap

func (sm *SafeMap) WriteMap(key, subkey string, value int)

WriteMap special when key:subkey has one value if new-value > old_value will be instead

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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