web

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindMultipartFile added in v1.3.6

func BindMultipartFile(c *gin.Context, handler func(filename string, fileLength int64, file io.Reader))

func BindMultipartFiles added in v1.3.7

func BindMultipartFiles(c *gin.Context, handler func(filename string, file io.Reader))

func Controller

func Controller(list ...func(g *gin.RouterGroup))

Controller 用于controller注册路由

func DELETE added in v1.1.3

func DELETE[P any, R any](uri string, server func(db *gorm.DB, param P) R)

func Fail added in v1.0.6

func Fail(c *gin.Context, code int, err error)

func GET added in v1.1.3

func GET[P any, R any](uri string, server func(db *gorm.DB, param P) R)

func Init

func Init(f func(r *gin.Engine))

Init 对外提供初始化路由的方法

func Interceptor

func Interceptor(handlers ...func(g *gin.Context))

Interceptor 用于注册拦截器

func POST added in v1.1.3

func POST[P any, R any](uri string, server func(db *gorm.DB, param P) R)

func PUT added in v1.1.3

func PUT[P any, R any](uri string, server func(db *gorm.DB, param P) R)

func Server added in v1.1.3

func Server[P any, R any](c *gin.Context, f func(db *gorm.DB, param P) R)

Server controller前后文处理(隐藏context,生成driver、规范化server函数)

func Success added in v1.0.6

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

Types

type Response added in v1.0.6

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

Jump to

Keyboard shortcuts

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