Documentation ¶
Index ¶
- Constants
- type Adapter
- func (a *Adapter) AddPolicy(_ string, ptype string, rule []string) (err error)
- func (a *Adapter) LoadPolicy(model model.Model) (err error)
- func (a *Adapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error
- func (a *Adapter) RemovePolicy(_ string, ptype string, rule []string) (err error)
- func (a *Adapter) SavePolicy(model model.Model) (err error)
Constants ¶
View Source
const (
PolicyKey = "casbin:policy"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
func NewFromClient ¶
NewFromClient returns a new instance of Adapter from an already existing go-redis client.
func NewFromURL ¶
NewFromDSN returns a new Adapter by using the given DSN. Format: redis://{password}:@{host}:{port}/{database} Example: redis://password:@host:6379/0
func (*Adapter) LoadPolicy ¶
LoadPolicy loads all policy rules from the storage.
func (*Adapter) RemoveFilteredPolicy ¶
func (*Adapter) RemovePolicy ¶
Click to show internal directories.
Click to hide internal directories.