Documentation
¶
Index ¶
- func NewAdapter(Sessionvar r.QueryExecutor) persist.Adapter
- type Adapter
- func (a *Adapter) AddPolicy(sec string, PTYPE string, policys []string) error
- func (a *Adapter) GetDatabaseName() string
- func (a *Adapter) GetTableName() string
- func (a *Adapter) LoadPolicy(model model.Model) error
- func (a *Adapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error
- func (a *Adapter) RemovePolicy(sec string, PTYPE string, policys []string) error
- func (a *Adapter) SavePolicy(model model.Model) error
- func (a *Adapter) SetDatabaseName(s string)
- func (a *Adapter) SetTableName(s string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAdapter ¶
func NewAdapter(Sessionvar r.QueryExecutor) persist.Adapter
NewAdapter is the constructor for Adapter.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter represents the RethinkDB Adapter for policy storage.
func (*Adapter) AddPolicy ¶
AddPolicy for adding a new policy to rethinkdb
func (*Adapter) GetDatabaseName ¶
GetDatabaseName returns the name of the database that the Adapter will use
func (*Adapter) GetTableName ¶
GetTableName returns the name of the table that the Adapter will use
func (*Adapter) LoadPolicy ¶
LoadPolicy loads policy from database.
func (*Adapter) RemoveFilteredPolicy ¶
func (a *Adapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error
RemoveFilteredPolicy for removing filtered policy
func (*Adapter) RemovePolicy ¶
RemovePolicy for removing a policy rule from rethinkdb
func (*Adapter) SavePolicy ¶
SavePolicy saves policy to database.
func (*Adapter) SetDatabaseName ¶
SetDatabaseName sets the database that the Adapter will use
Click to show internal directories.
Click to hide internal directories.