Documentation ¶
Index ¶
- Constants
- type Adapter
- func (a *Adapter) AddPolicies(sec string, ptype string, rules [][]string) error
- func (a *Adapter) AddPolicy(sec string, ptype string, line []string) error
- func (a *Adapter) LoadPolicy(model model.Model) error
- func (a *Adapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error
- func (a *Adapter) RemovePolicies(sec string, ptype string, rules [][]string) error
- func (a *Adapter) RemovePolicy(sec string, ptype string, line []string) error
- func (a *Adapter) SavePolicy(model model.Model) error
- type CasbinRule
Constants ¶
View Source
const ( REQUESTTIMEOUT = 5 * time.Second // PLACEHOLDER represent the NULL value in the Casbin Rule. PLACEHOLDER = "_" // DEFAULT_KEY is the root path in ETCD, if not provided. DEFAULT_KEY = "casbin_policy" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter represents the ETCD adapter for policy storage.
func NewAdapter ¶
func (*Adapter) AddPolicies ¶ added in v1.1.0
AddPolicies adds policy rules to the storage. This is part of the Auto-Save feature.
func (*Adapter) AddPolicy ¶
AddPolicy adds a policy rule to the storage. Part of the Auto-Save feature.
func (*Adapter) LoadPolicy ¶
LoadPolicy loads all of policys from ETCD
func (*Adapter) RemoveFilteredPolicy ¶
func (a *Adapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error
RemoveFilteredPolicy removes policy rules that match the filter from the storage. Part of the Auto-Save feature.
func (*Adapter) RemovePolicies ¶ added in v1.1.0
RemovePolicies removes policy rules from the storage. This is part of the Auto-Save feature.
func (*Adapter) RemovePolicy ¶
RemovePolicy removes a policy rule from the storage. Part of the Auto-Save feature.
Click to show internal directories.
Click to hide internal directories.