Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBAdapter ¶
type DBAdapter struct {
// contains filtered or unexported fields
}
The database adapter for policy persistence, can load policy from database or save policy to database. For now, only MySQL is tested, but it should work for other RDBMS.
func NewDBAdapter ¶
The constructor for DBAdapter.
func (*DBAdapter) LoadPolicy ¶
Load policy from database.
func (*DBAdapter) SavePolicy ¶
Save policy to database.
type FileAdapter ¶
type FileAdapter struct {
// contains filtered or unexported fields
}
The file adapter for policy persistence, can load policy from file or save policy to file.
func NewFileAdapter ¶
func NewFileAdapter(filePath string) *FileAdapter
The constructor for FileAdapter.
func (*FileAdapter) LoadPolicy ¶
func (a *FileAdapter) LoadPolicy(model casbin.Model)
Load policy from file.
func (*FileAdapter) SavePolicy ¶
func (a *FileAdapter) SavePolicy(model casbin.Model)
Save policy to file.
Click to show internal directories.
Click to hide internal directories.