persist

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	LoadPolicy(model model.Model) error
	SavePolicy(model model.Model) error
}

Adapter represents the abstract adapter interface for policy persistence. FileAdapter, DBAdapter inherits this interface.

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) error

LoadPolicy loads policy from file.

func (*FileAdapter) SavePolicy

func (a *FileAdapter) SavePolicy(model model.Model) error

SavePolicy saves policy to file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL