h

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ENotFound              = &AppErr{http.StatusNotFound, "NotFound", nil}
	EParamsError           = &AppErr{http.StatusBadRequest, "ParamsError", nil}
	EBindBodyError         = &AppErr{http.StatusBadRequest, "BindBodyError", nil}
	EStatusError           = &AppErr{http.StatusBadRequest, "StatusError", nil}
	EUnknown               = &AppErr{http.StatusInternalServerError, "Unknown", nil}
	EExists                = &AppErr{http.StatusConflict, "Exists", nil}
	EDeployControllerError = &AppErr{http.StatusInternalServerError, "DeployControllerError", nil}
)

Functions

func E

func E(c *gin.Context, e error)

func R

func R(c *gin.Context, body interface{})

func RJsonP

func RJsonP(c *gin.Context, body interface{})

Types

type AppErr

type AppErr struct {
	Status  int         `json:"-"`
	Msg     string      `json:"msg"`
	Payload interface{} `json:"payload"`
}

func NewAppErr

func NewAppErr(code int, msg string, payload interface{}) *AppErr

func WrapErr

func WrapErr(err error, msg ...string) *AppErr

func (*AppErr) Error

func (e *AppErr) Error() string

func (*AppErr) WithPayload

func (e *AppErr) WithPayload(payload interface{}) *AppErr

type H

type H = map[string]interface{}

Jump to

Keyboard shortcuts

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