handler

package
v0.0.0-...-2b22c89 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindParam

func BindParam(c *gin.Context, obj any) bool

func EmbedFolder

func EmbedFolder(fsEmbed embed.FS, targetPath string) static.ServeFileSystem

func ReturnError

func ReturnError(c *gin.Context, code errCode, err error)

ReturnError 返回错误

func ReturnJSON

func ReturnJSON(c *gin.Context, data any)

ReturnJSON 返回正确的业务数据

func ReturnUnauthorized

func ReturnUnauthorized(c *gin.Context, code errCode, err ...error)

Types

type Register

type Register interface {
	RegisterHandler(g *gin.Engine)
}

func NewRESTfulHandler

func NewRESTfulHandler(db *db.DB,
	cnf *config.Web,
	oob *config.OOB,
	eventbus *event.EventBus,
	recorder *record.Recorder) Register

type Result

type Result struct {
	Code errCode     `json:"code"`
	Msg  string      `json:"message,omitempty"`
	Data interface{} `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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