Files
backend/internal/config/casbin.go

23 lines
612 B
Go
Raw Normal View History

package config
// CasbinConfig Casbin 配置
type CasbinConfig struct {
// ModelPath Casbin 模型文件路径
ModelPath string `mapstructure:"model_path"`
// AutoSave 是否自动保存策略到数据库
AutoSave bool `mapstructure:"auto_save"`
// AutoLoad 是否自动从数据库加载策略
AutoLoad bool `mapstructure:"auto_load"`
// EnableCache 是否启用 Redis 缓存
EnableCache bool `mapstructure:"enable_cache"`
// CacheTTL 缓存过期时间 (秒)
CacheTTL int `mapstructure:"cache_ttl"`
// SkipRoutes 跳过权限检查的路由
SkipRoutes []string `mapstructure:"skip_routes"`
}