Documentation ¶
Index ¶
- func NewAdapter(driverName, dataSourceName string, opts ...adapterOption) (*bunAdapter, error)
- func NewAdapterWithBunDB(db *bun.DB, opts ...adapterOption) (*bunAdapter, error)
- func NewAdapterWithSqlDB(sqlDB *sql.DB, driverName string, opts ...adapterOption) (*bunAdapter, error)
- func NewCtxAdapter(driverName string, dataSourceName string, opts ...adapterOption) (*ctxBunAdapter, error)
- func WithDebugMode() adapterOption
- type CasbinPolicy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAdapter ¶
func NewAdapterWithBunDB ¶ added in v1.0.1
func NewAdapterWithSqlDB ¶ added in v1.0.1
func NewCtxAdapter ¶
func WithDebugMode ¶
func WithDebugMode() adapterOption
Types ¶
type CasbinPolicy ¶
type CasbinPolicy struct { bun.BaseModel `bun:"casbin_policies,alias:cp"` ID int64 `bun:"id,pk,autoincrement"` PType string `bun:"ptype,type:varchar(100),notnull"` V0 string `bun:"v0,type:varchar(100)"` V1 string `bun:"v1,type:varchar(100)"` V2 string `bun:"v2,type:varchar(100)"` V3 string `bun:"v3,type:varchar(100)"` V4 string `bun:"v4,type:varchar(100)"` V5 string `bun:"v5,type:varchar(100)"` }
Database storage format following the below https://casbin.org/docs/policy-storage#database-storage-format
Click to show internal directories.
Click to hide internal directories.