Documentation
¶
Index ¶
- type CasbinGoroseAdapter
- func (a *CasbinGoroseAdapter) AddPolicy(sec string, ptype string, rule []string) error
- func (a *CasbinGoroseAdapter) LoadPolicy(model model.Model) error
- func (a *CasbinGoroseAdapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error
- func (a *CasbinGoroseAdapter) RemovePolicy(sec string, ptype string, rule []string) error
- func (a *CasbinGoroseAdapter) SavePolicy(model model.Model) error
- type CasbinRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CasbinGoroseAdapter ¶
type CasbinGoroseAdapter struct {
*gorose.Engin
}
Adapter is the file adapter for Casbin. It can load policy from file or save policy to file.
func NewAdapter ¶
func NewAdapter(ge *gorose.Engin) *CasbinGoroseAdapter
NewCasbinGoroseAdapter is the constructor for Adapter.
func (*CasbinGoroseAdapter) AddPolicy ¶
func (a *CasbinGoroseAdapter) AddPolicy(sec string, ptype string, rule []string) error
AddPolicy adds a policy rule to the storage.
func (*CasbinGoroseAdapter) LoadPolicy ¶
func (a *CasbinGoroseAdapter) LoadPolicy(model model.Model) error
LoadPolicy loads all policy rules from the storage.
func (*CasbinGoroseAdapter) RemoveFilteredPolicy ¶
func (a *CasbinGoroseAdapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error
RemoveFilteredPolicy removes policy rules that match the filter from the storage.
func (*CasbinGoroseAdapter) RemovePolicy ¶
func (a *CasbinGoroseAdapter) RemovePolicy(sec string, ptype string, rule []string) error
RemovePolicy removes a policy rule from the storage.
func (*CasbinGoroseAdapter) SavePolicy ¶
func (a *CasbinGoroseAdapter) SavePolicy(model model.Model) error
SavePolicy saves all policy rules to the storage.
type CasbinRule ¶
type CasbinRule struct { Id string `gorose:"id"` PType string `gorose:"p_type"` V0 string `gorose:"v0"` V1 string `gorose:"v1"` V2 string `gorose:"v2"` V3 string `gorose:"v3"` V4 string `gorose:"v4"` V5 string `gorose:"v5"` }
CasbinRule casbin_rule table
func (CasbinRule) TableName ¶
func (CasbinRule) TableName() string
TableName return table's true name
Click to show internal directories.
Click to hide internal directories.