Documentation ¶
Index ¶
- func BuildContainer() (*dig.Container, func())
- func Init(ctx context.Context, opts ...Option) func()
- func InitAuth() (auth.Auther, error)
- func InitCaptcha()
- func InitCasbinEnforcer(container *dig.Container) error
- func InitData(ctx context.Context, container *dig.Container) error
- func InitHTTPServer(ctx context.Context, container *dig.Container) func()
- func InitLogger() (func(), error)
- func InitMonitor() error
- func InitStore(container *dig.Container) (func(), error)
- func InitWeb(container *dig.Container) *gin.Engine
- func NewCasbinEnforcer() *casbin.SyncedEnforcer
- func ReleaseCasbinEnforcer(container *dig.Container)
- type CasbinAdapter
- func (a *CasbinAdapter) AddPolicy(sec string, ptype string, rule []string) error
- func (a *CasbinAdapter) LoadPolicy(model model.Model) error
- func (a *CasbinAdapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error
- func (a *CasbinAdapter) RemovePolicy(sec string, ptype string, rule []string) error
- func (a *CasbinAdapter) SavePolicy(model model.Model) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitCasbinEnforcer ¶
InitCasbinEnforcer 初始化casbin校验器
func InitHTTPServer ¶
InitHTTPServer 初始化http服务
func NewCasbinEnforcer ¶
func NewCasbinEnforcer() *casbin.SyncedEnforcer
NewCasbinEnforcer 创建casbin校验器
func ReleaseCasbinEnforcer ¶
ReleaseCasbinEnforcer 释放casbin资源
Types ¶
type CasbinAdapter ¶
CasbinAdapter casbin适配器
func NewCasbinAdapter ¶
func NewCasbinAdapter(bRole bll.IRole, bUser bll.IUser) *CasbinAdapter
NewCasbinAdapter 创建casbin适配器
func (*CasbinAdapter) AddPolicy ¶
func (a *CasbinAdapter) AddPolicy(sec string, ptype string, rule []string) error
AddPolicy adds a policy rule to the storage. This is part of the Auto-Save feature.
func (*CasbinAdapter) LoadPolicy ¶
func (a *CasbinAdapter) LoadPolicy(model model.Model) error
LoadPolicy loads all policy rules from the storage.
func (*CasbinAdapter) RemoveFilteredPolicy ¶
func (a *CasbinAdapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error
RemoveFilteredPolicy removes policy rules that match the filter from the storage. This is part of the Auto-Save feature.
func (*CasbinAdapter) RemovePolicy ¶
func (a *CasbinAdapter) RemovePolicy(sec string, ptype string, rule []string) error
RemovePolicy removes a policy rule from the storage. This is part of the Auto-Save feature.
func (*CasbinAdapter) SavePolicy ¶
func (a *CasbinAdapter) SavePolicy(model model.Model) error
SavePolicy saves all policy rules to the storage.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package routers 生成swagger文档 文档规则请参考:https://github.com/swaggo/swag#declarative-comments-format 使用方式: go get -u github.com/swaggo/swag/cmd/swag swag init -g ./internal/app/routers/swagger.go -o ./docs/swagger
|
Package routers 生成swagger文档 文档规则请参考:https://github.com/swaggo/swag#declarative-comments-format 使用方式: go get -u github.com/swaggo/swag/cmd/swag swag init -g ./internal/app/routers/swagger.go -o ./docs/swagger |
Package test 接口测试 使用方式: go test -v
|
Package test 接口测试 使用方式: go test -v |
Click to show internal directories.
Click to hide internal directories.