Skip to content

介绍

路由模块

使用方法

go
import (
	"github.com/wallace5303/ee-go/erouter"
)

API列表

仅做简单介绍。按照go标准,常量/函数/方法等说明信息,都在源码中。

func Handle(httpMethod, path string, handler HandlerFunc)

注册路由

type HandlerFunc

type Ctx

type Ctx struct {
	GinCtx *gin.Context   // gin context
	Err    any            // 请求错误
	Timed  int64          // 执行时间
	Args   map[string]any // 请求参数
}

func (c *Ctx) JSON(data any)

返回json格式的数据

func (c *Ctx) JSONWithCode(code int, data any)

返回json格式的数据,包含http状态码

ArgJson() (arg map[string]any, ok bool)

解析json格式的参数