Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
View Source
var Enforcer casbin.IEnforcer
Functions ¶
This section is empty.
Types ¶
type CasbinRule ¶ added in v0.1.1
type CasbinRule struct {
PType string `json:"pType" gorm:"size:100;"`
V0 string `json:"v0" gorm:"size:100;"`
V1 string `json:"v1" gorm:"size:100;"`
V2 string `json:"v2" gorm:"size:100;"`
V3 string `json:"v3" gorm:"size:100;"`
V4 string `json:"v4" gorm:"size:100;"`
V5 string `json:"v5" gorm:"size:100;"`
}
func (*CasbinRule) TableName ¶ added in v0.1.1
func (*CasbinRule) TableName() string
type Configure ¶
func NewConfigure ¶
func NewConfigure( dsn string, maxIdleConns, maxOpenConns, connMaxIdleTime, connMaxLifetime int, registers []ResolverConfigure) Configure
NewConfigure 初始化 Configure
type DBResolverConfig ¶
type Database ¶
type Database struct {
Driver string `yaml:"driver"`
Source string `yaml:"source"`
ConnMaxIdleTime int `yaml:"connMaxIdleTime"`
ConnMaxLifeTime int `yaml:"connMaxLifeTime"`
MaxIdleConns int `yaml:"maxIdleConns"`
MaxOpenConns int `yaml:"maxOpenConns"`
Registers []DBResolverConfig `yaml:"registers"`
CasbinModel string `yaml:"casbinModel"`
}
type ResolverConfigure ¶
type ResolverConfigure interface {
Init(*dbresolver.DBResolver, func(string) gorm.Dialector) *dbresolver.DBResolver
}
func NewResolverConfigure ¶
func NewResolverConfigure(sources, replicas []string, policy string, tables []string) ResolverConfigure
NewResolverConfigure 初始化 ResolverConfigure
Click to show internal directories.
Click to hide internal directories.