Documentation ¶
Index ¶
Constants ¶
View Source
const ( // casbin 初始化可能的错误 ErrorCasbinCanNotUseDbPtr string = "" /* 138-byte string literal not displayed */ ErrorCasbinCreateAdaptFail string = "casbin NewAdapterByDBUseTableName 发生错误:" ErrorCasbinCreateEnforcerFail string = "casbin NewEnforcer 发生错误:" ErrorCasbinNewModelFromStringFail string = "NewModelFromString 调用时出错:" ErrorsCasbinNoAuthorization string = "Casbin 鉴权未通过,请在后台检查 casbin 设置参数" )
Variables ¶
This section is empty.
Functions ¶
func ErrorCasbinAuthFail ¶
casbin 鉴权失败,返回 405 方法不允许访问
func InitCasbinEnforcer ¶
func InitCasbinEnforcer() (*casbin.SyncedEnforcer, error)
创建 Casbin Enforcer(执行器): 初始化: 1. 自动创建数据库表 2. 加载策略 3. 设置自动加载策略间隔
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.