Documentation
¶
Index ¶
- type Adapter
- func (a *Adapter) AddPolicy(sec string, ptype string, rule []string) error
- func (a *Adapter) AddPolicyCtx(ctx context.Context, sec string, ptype string, rule []string) error
- func (a *Adapter) LoadPolicy(model model.Model) error
- func (a *Adapter) LoadPolicyCtx(ctx context.Context, model model.Model) error
- func (a *Adapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error
- func (a *Adapter) RemoveFilteredPolicyCtx(ctx context.Context, sec string, ptype string, fieldIndex int, ...) error
- func (a *Adapter) RemovePolicy(sec string, ptype string, rule []string) error
- func (a *Adapter) RemovePolicyCtx(ctx context.Context, sec string, ptype string, rule []string) error
- func (a *Adapter) SavePolicy(model model.Model) error
- func (a *Adapter) SavePolicyCtx(ctx context.Context, model model.Model) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
Line string
}
Adapter is the string adapter for Casbin. It can load policy from string or save policy to string.
func (*Adapter) AddPolicyCtx ¶ added in v2.128.0
AddPolicyCtx adds a policy rule to the storage with context.
func (*Adapter) LoadPolicy ¶
LoadPolicy loads all policy rules from the storage.
func (*Adapter) LoadPolicyCtx ¶ added in v2.128.0
LoadPolicyCtx loads all policy rules from the storage with context.
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.
func (*Adapter) RemoveFilteredPolicyCtx ¶ added in v2.128.0
func (a *Adapter) RemoveFilteredPolicyCtx(ctx context.Context, sec string, ptype string, fieldIndex int, fieldValues ...string) error
RemoveFilteredPolicyCtx removes policy rules that match the filter from the storage with context.
func (*Adapter) RemovePolicy ¶
RemovePolicy removes a policy rule from the storage.
func (*Adapter) RemovePolicyCtx ¶ added in v2.128.0
func (a *Adapter) RemovePolicyCtx(ctx context.Context, sec string, ptype string, rule []string) error
RemovePolicyCtx removes a policy rule from the storage with context.
func (*Adapter) SavePolicy ¶
SavePolicy saves all policy rules to the storage.