router

package
v2.0.77 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, f func(*Router))

Register 注册路由

Types

type Config

type Config struct {
	Prefix               string                 // 路由前缀
	NoAuthSkipURL        []string               // 不需要认证路由白名单地址
	NoPerimissionSkipURL []string               // 不需要权限路由白名单地址
	Auth                 auth.Auther            // JWT认证
	CasbinEnforcer       *casbin.SyncedEnforcer // casbin权限校验
}

Config 路由配置

type Router

type Router struct {
	R              *gin.Engine
	Auth           auth.Auther
	CasbinEnforcer *casbin.SyncedEnforcer
}

Router 路由模型

func NewRouter

func NewRouter(c *Config) *Router

NewRouter 初始化路由

Jump to

Keyboard shortcuts

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