Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidDatabaseLink = errors.New("invalid database link")
)
Functions ¶
This section is empty.
Types ¶
type Enforcer ¶
type Enforcer = casbin.Enforcer
func NewEnforcer ¶
NewEnforcer create a casbin enforcer.
type Options ¶
type Options struct { Model string // model config file path Debug bool // debug mode Enable bool // enable permission AutoLoad bool // auto load policy Duration time.Duration // auto load duration DB gdb.DB // database instance, Choose between DB and Link parameters. If DB exists, use DB first. Link string // database source url, Choose between DB and Link parameters. If the DB parameter does not exist, create a DB instance with the Link parameter. example: mysql:root:12345678@tcp(127.0.0.1:3306)/test Table string // database policy table name }
Click to show internal directories.
Click to hide internal directories.