adapter

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadPolicyLine

func LoadPolicyLine(line string, m api.IAddRuleBool) error

LoadPolicyLine loads a text line as a policy rule to model.

Types

type FileAdapter

type FileAdapter struct {
	// contains filtered or unexported fields
}

func NewFileAdapter

func NewFileAdapter(path string) *FileAdapter

func (*FileAdapter) AddRule

func (a *FileAdapter) AddRule(rule []string) error

func (*FileAdapter) AddRules

func (a *FileAdapter) AddRules(rules [][]string) error

func (*FileAdapter) LoadPolicy

func (a *FileAdapter) LoadPolicy(model api.IAddRuleBool) error

func (*FileAdapter) RemoveRule

func (a *FileAdapter) RemoveRule(rule []string) error

func (*FileAdapter) RemoveRules

func (a *FileAdapter) RemoveRules(rules [][]string) error

func (*FileAdapter) SavePolicy

func (a *FileAdapter) SavePolicy(model api.IRangeRules) error

type NoopAdapter

type NoopAdapter struct{}

func (*NoopAdapter) AddRule

func (a *NoopAdapter) AddRule(rule []string) error

func (*NoopAdapter) LoadPolicy

func (a *NoopAdapter) LoadPolicy(model api.IAddRuleBool) error

func (*NoopAdapter) RemoveRule

func (a *NoopAdapter) RemoveRule(rule []string) error

func (*NoopAdapter) SavePolicy

func (a *NoopAdapter) SavePolicy(model api.IRangeRules) error

type RuleSet

type RuleSet struct {
	*policy.Policy
}

func NewRuleSet

func NewRuleSet() *RuleSet

func (*RuleSet) RangeRules

func (set *RuleSet) RangeRules(fn func(rule []string) bool)

func (*RuleSet) Rules

func (set *RuleSet) Rules() [][]string

Jump to

Keyboard shortcuts

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