Documentation ¶
Index ¶
Constants ¶
View Source
const (
PolicyKey = "casbin:policy"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapte ¶
type Adapte interface { // LoadPolicy loads all policy rules from the storage. LoadPolicy(model model.Model) error // SavePolicy saves all policy rules to the storage. SavePolicy(model model.Model) error // AddPolicy adds a policy rule to the storage. // This is part of the Auto-Save feature. AddPolicy(sec string, ptype string, rule []string) error // RemovePolicy removes a policy rule from the storage. // This is part of the Auto-Save feature. RemovePolicy(sec string, ptype string, rule []string) error // RemoveFilteredPolicy removes policy rules that match the filter from the storage. // This is part of the Auto-Save feature. RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error }
Adapter is the interface for Casbin adapters.
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
func NewAdapter ¶
func (*Adapter) LoadPolicy ¶
LoadPolicy loads all policy rules from the storage.
func (*Adapter) SelectRow ¶
func (a *Adapter) SelectRow() (*CasbinRule, error)
func (*Adapter) SelectRows ¶
func (a *Adapter) SelectRows() ([]*CasbinRule, error)
Click to show internal directories.
Click to hide internal directories.