router

package
v0.0.0-...-18988c4 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package router ...

Description : 便捷的相关API处理

Author : go_developer@163.com<白茶清欢>

Date : 2021-03-26 2:06 下午

Package router ...

Description : 注册路由

Author : go_developer@163.com<白茶清欢>

Date : 2021-03-26 2:13 下午

Package router ...

Description : router ...

Author : go_developer@163.com<白茶清欢>

Date : 2023-03-03 16:48

Index

Constants

This section is empty.

Variables

View Source
var (
	// DebugLogEnable 默认打开debug日志
	DebugLogEnable = true
)

Functions

func DisableDebugLog

func DisableDebugLog()

DisableDebugLog 禁用debug日志

Author : go_developer@163.com<白茶清欢>

Date : 2:17 下午 2021/3/26

func HandleRegisterRouter

func HandleRegisterRouter(router *gin.Engine, method string, uri string, handler gin.HandlerFunc, middlewareList []gin.HandlerFunc) error

HandleRegisterRouter 注册gin路由

Author : go_developer@163.com<白茶清欢>

Date : 8:36 下午 2021/3/9

func RegisterRouter

func RegisterRouter(router *gin.Engine, apiInstanceList ...any) error

RegisterRouter 注册一个路由

Author : go_developer@163.com<白茶清欢>

Date : 2:14 下午 2021/3/26

func RegisterRouterGroup

func RegisterRouterGroup(router *gin.RouterGroup, method string, uri string, handler gin.HandlerFunc) error

RegisterRouterGroup 注册gin路由

Author : go_developer@163.com<白茶清欢>

Date : 8:36 下午 2021/3/9

Types

type IApi

type IApi interface {
	// GetMethod 接口请求方法
	GetMethod() string
	// GetURI 接口URI
	GetURI() string
	// GetMiddleWareList 使用的中间件列表
	GetMiddleWareList() []gin.HandlerFunc
	// GetHandler 处理的handler
	GetHandler() gin.HandlerFunc
}

IApi 每一个接口的实现约束

Author : go_developer@163.com<白茶清欢>

Date : 2:08 下午 2021/3/26

type RegisterFunc

type RegisterFunc func() (method string, uri string, handlerFunc gin.HandlerFunc, middlewareList []gin.HandlerFunc)

RegisterFunc 注册路由的函数

Author : go_developer@163.com<白茶清欢>

Date : 3:09 下午 2021/3/26

Jump to

Keyboard shortcuts

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