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 NewSqlite(app *koa.Koa, filename string) (koa.PluginMultiArg, *sql.DB)
- func NewStatic(prefix string, dir string) koa.PluginSingleArg
- type Auth
- type AuthMap
- type AuthPolicy
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 * 该架构完美解耦游客和登录用户的权限,同时可以支持为游客设置权限,酷!
Types ¶
Click to show internal directories.
Click to hide internal directories.