autoroute

package
v0.0.0-...-212a885 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoRoute

func AutoRoute(controller AutoRouter) func(*gin.Context)

AutoRoute 自动路由设置,URL 路径名称要小写 prefix 表示需要关联的前缀 controller 控制器类

func DataMsg

func DataMsg(c *gin.Context, data interface{}, msg string, code ...int)

*

  • @description: 生成json数据
  • @param {*gin.Context} c
  • @param {interface{}} data
  • @param {string} msg
  • @param {...int} code
  • @return {*}

func DefaultUploadHtml

func DefaultUploadHtml(writer gin.ResponseWriter, extend string)

func GetStackTraceInfo

func GetStackTraceInfo(msg string) (info string)

GetStackTraceInfo 获取堆栈信息

func Normal

func Normal(engine *gin.Engine, relativePath string, router AutoRouter, handlers ...gin.HandlerFunc)

Normal Get & Post

func RunListener

func RunListener(listener net.Listener, engine *gin.Engine, certFile, keyFile string) (err error)

RunListener 自动选择HTTP 或者 HTTPS服务 certFile, keyFile 不可用时以http启动,否则 以 tls启动

func Setup

func Setup(engine *gin.Engine)

Setup initialize

func StackTrace

func StackTrace() string

StackTrace 栈信息

func Str2html

func Str2html(raw string) template.HTML

Str2html Convert string to template.HTML type.

Types

type AutoRouter

type AutoRouter interface {
	//初始化 context
	Setup(c *gin.Context, controllerName string) error
}

AutoRouter 自动路由接口

Directories

Path Synopsis
* @Author: Wangjun * @Date: 2021-05-15 22:43:19 * @LastEditTime: 2021-07-20 11:34:01 * @LastEditors: Wangjun * @Description: * @FilePath: \golib\autoroute\controller\auth.go * hnxr
* @Author: Wangjun * @Date: 2021-05-15 22:43:19 * @LastEditTime: 2021-07-20 11:34:01 * @LastEditors: Wangjun * @Description: * @FilePath: \golib\autoroute\controller\auth.go * hnxr
* @Author: Wangjun * @Date: 2023-09-01 13:39:49 * @LastEditTime: 2024-04-01 14:03:57 * @LastEditors: wangjun haodreams@163.com * @Description:创建默认的router * @FilePath: \xrdatad:\go\src\gitee.com\haodreams\golib\autoroute\defaulter\default.go * hnxr
* @Author: Wangjun * @Date: 2023-09-01 13:39:49 * @LastEditTime: 2024-04-01 14:03:57 * @LastEditors: wangjun haodreams@163.com * @Description:创建默认的router * @FilePath: \xrdatad:\go\src\gitee.com\haodreams\golib\autoroute\defaulter\default.go * hnxr
* @Author: Wangjun * @Date: 2021-07-19 19:31:56 * @LastEditTime: 2023-07-20 13:38:58 * @LastEditors: Wangjun * @Description: * @FilePath: \golib\autoroute\minauth\user.go * hnxr
* @Author: Wangjun * @Date: 2021-07-19 19:31:56 * @LastEditTime: 2023-07-20 13:38:58 * @LastEditors: Wangjun * @Description: * @FilePath: \golib\autoroute\minauth\user.go * hnxr
* @Author: Wangjun * @Date: 2021-11-01 10:59:05 * @LastEditTime: 2021-11-01 11:06:03 * @LastEditors: Wangjun * @Description: * @FilePath: \xr_ai_monitord:\go\src\gitee.com\haodreams\golib\autoroute\restdef\restdef.go * hnxr
* @Author: Wangjun * @Date: 2021-11-01 10:59:05 * @LastEditTime: 2021-11-01 11:06:03 * @LastEditors: Wangjun * @Description: * @FilePath: \xr_ai_monitord:\go\src\gitee.com\haodreams\golib\autoroute\restdef\restdef.go * hnxr

Jump to

Keyboard shortcuts

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