electron-egg electron-egg
首页
  • v4.x
  • v3.x
  • v2.x
插件
  • v4.x
  • v3.x
demo
支持
知识点
案例
交流
  • GitHub (opens new window)
  • Gitee (opens new window)
首页
  • v4.x
  • v3.x
  • v2.x
插件
  • v4.x
  • v3.x
demo
支持
知识点
案例
交流
  • GitHub (opens new window)
  • Gitee (opens new window)
❤️成为赞助商
  • 教程

  • ee-bin

  • ee-core

  • ee-go

    • eapp
    • eboot
    • econfig
    • eerror
    • ehelper
    • ehttp
    • erouter
      • elog
      • eos
      • eruntime
      • estatic
      • eutil
      • etask
    目录

    erouter

    ee-go:v1.0.0

    # 介绍

    路由模块

    # 使用方法

    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格式的参数

    上次更新: 2025/06/06, 07:21:49
    ehttp
    elog

    ← ehttp elog→

    Theme by Vdoing | Copyright © 2023-2025 哆啦好梦 | 京ICP备15041380号-2
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式
    ×