Documentation
¶
Index ¶
- func NewAuth(subject func(ctx *koa.Context) any, environment func(ctx *koa.Context) any, ...) koa.PluginMultiArg
- func NewConfig[T any](filename string, config T) (koa.PluginMultiArg, *T)
- func NewJsonParser(maxLenBytes int) koa.PluginMultiArg
- func NewLogger(debug bool) koa.PluginMultiArg
- func NewProxy(mappings map[string][]string) koa.PluginMultiArg
- func NewRouter(mapping map[string]koa.Plugin) koa.PluginMultiArg
- func NewSecure(CSRF bool, CORS bool, XSS bool) koa.PluginMultiArg
- func NewSession(capacity int, maxAge int) koa.PluginMultiArg
- func NewSqlite(app *koa.Koa, filename string) (koa.PluginMultiArg, *sql.DB)
- func NewStatic(prefix string, dir string) koa.PluginSingleArg
- type Auth
- type AuthMap
- type AuthPolicy
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAuth ¶
func NewAuth( subject func(ctx *koa.Context) any, environment func(ctx *koa.Context) any, objects map[reflect.Type]AuthMap, policies map[reflect.Type]AuthPolicy, ) koa.PluginMultiArg
* ABAC * 该架构完美解耦游客和登录用户的权限,同时可以支持为游客设置权限,酷!
func NewConfig ¶
func NewConfig[T any](filename string, config T) (koa.PluginMultiArg, *T)
* 读取yaml配置文件
func NewSession ¶
func NewSession(capacity int, maxAge int) koa.PluginMultiArg
* 最简Session实现 @param maxAge 超时时间(s)
Types ¶
type AuthPolicy ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.