xgin

package
v0.0.0-...-9f39f39 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUCCESS       = 0
	BusinessError = 501 // 逻辑异常
	ERROR         = 500 // 服务器内部逻辑异常
	NoFind        = 404
	ERROR_PARAM   = 400 // 参数错误
)

Variables

This section is empty.

Functions

func Fail

func Fail(c *gin.Context)

func FailWithData

func FailWithData(c *gin.Context, ResData interface{})

func FailWithDetailed

func FailWithDetailed(c *gin.Context, ResCode int, ResMsg interface{}, ResData interface{})

func FailWithError

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

func FailWithMessage

func FailWithMessage(c *gin.Context, ResMsg interface{})

func Ok

func Ok(c *gin.Context)

func OkDetailed

func OkDetailed(c *gin.Context, ResMsg interface{}, ResData interface{})

func OkWithData

func OkWithData(c *gin.Context, ResData interface{})

func OkWithMessage

func OkWithMessage(c *gin.Context, ResMsg interface{})

func Result

func Result(c *gin.Context, ResCode int, ResMsg interface{}, ResData interface{})

Types

type GinService

type GinService struct {
	*gin.Engine
}

func NewGinService

func NewGinService() *GinService

NewGinService 注册一个新的GinService

func (*GinService) Name

func (g *GinService) Name() string

func (*GinService) OpenHealthApi

func (s *GinService) OpenHealthApi() error

func (*GinService) StartUp

func (g *GinService) StartUp() error

func (*GinService) Stop

func (g *GinService) Stop()

type Response

type Response struct {
	Code int         `json:"code"`
	Data interface{} `json:"data"`
	Msg  interface{} `json:"msg"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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