routes

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMw

func AuthMw(redir bool) func(next http.Handler) http.Handler

AuthMw 返回认证中间件

func Authzr

func Authzr() staffio.Authorizer

Authzr 获取 staffio Authorizer 单例

func Register

func Register(name string, sf Strapper)

Register 线程安全,供各业务包 init() 调用

func Routers

func Routers(r any, names ...string)

Routers 统一挂载,r 传入具体的路由器实例

Types

type Strapper

type Strapper interface {
	Strap(r any)
}

Strapper 接收 any,与具体框架解耦

func StrapFunc

func StrapFunc[R any](fn func(R)) Strapper

StrapFunc 泛型辅助:让业务包写有类型的函数,内部自动处理断言 类型断言发生在已经依赖框架的业务包里

Jump to

Keyboard shortcuts

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