Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
Adapter represents the abstract adapter interface for policy persistence. FileAdapter, DBAdapter inherits this interface.
type DBAdapter ¶
type DBAdapter struct {
// contains filtered or unexported fields
}
DBAdapter represents 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 ¶
NewDBAdapter is the constructor for DBAdapter.
func (*DBAdapter) LoadPolicy ¶
LoadPolicy loads policy from database.
func (*DBAdapter) SavePolicy ¶
SavePolicy saves policy to database.
type FileAdapter ¶
type FileAdapter struct {
// contains filtered or unexported fields
}
FileAdapter represents the file adapter for policy persistence, can load policy from file or save policy to file.
func NewFileAdapter ¶
func NewFileAdapter(filePath string) *FileAdapter
NewFileAdapter is the constructor for FileAdapter.
func (*FileAdapter) LoadPolicy ¶
func (a *FileAdapter) LoadPolicy(model model.Model)
LoadPolicy loads policy from file.
func (*FileAdapter) SavePolicy ¶
func (a *FileAdapter) SavePolicy(model model.Model)
SavePolicy saves policy to file.