policy

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: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EVT_RULE_ADDED   em.EventType = "rule_added"
	EVT_RULE_REMOVED em.EventType = "rule_removed"
	EVT_CLEARED      em.EventType = "cleared"
)

Variables

This section is empty.

Functions

func GetDistinct

func GetDistinct(p IPolicy, columns []int) ([][]string, error)

Types

type IPolicy

type IPolicy interface {
	api.IAddRuleBool
	api.IRemoveRuleBool
	api.IAddRemoveListener
	api.IClear

	Range(fn func(rule []string) bool)
}

type Policy

type Policy struct {
	*em.Emitter
	*defs.PolicyDef
	// contains filtered or unexported fields
}

func NewPolicy

func NewPolicy(pDef *defs.PolicyDef) *Policy

func (*Policy) AddRule

func (p *Policy) AddRule(rule []string) (bool, error)

func (*Policy) Clear

func (p *Policy) Clear() error

func (*Policy) GetDistinct

func (p *Policy) GetDistinct(columns []int) ([][]string, error)

func (*Policy) Range

func (p *Policy) Range(fn func(rule []string) bool)

func (*Policy) RemoveRule

func (p *Policy) RemoveRule(rule []string) (bool, error)

Jump to

Keyboard shortcuts

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