router

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 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                 // 路由前缀
	SkipURL        []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