rule

package
v0.0.0-...-e25560c Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Egress string
	Policy policy.Policy
}

func NewAction

func NewAction(e string, p string) *Action

type Default

type Default Action

func NewRuleDefault

func NewRuleDefault() *Default

func (*Default) Empty

func (d *Default) Empty() bool

func (*Default) Insert

func (d *Default) Insert(a ...any) error

func (*Default) Match

func (d *Default) Match(m message.Metadata, others ...any) (*Action, bool)

func (*Default) Name

func (d *Default) Name() string

type Domain

type Domain struct {
	*trie.Trie
}

func NewRuleDomain

func NewRuleDomain(t *trie.Trie) *Domain

func (*Domain) Empty

func (d *Domain) Empty() bool

func (*Domain) Insert

func (d *Domain) Insert(a ...any) error

func (*Domain) Match

func (d *Domain) Match(m message.Metadata, others ...any) (*Action, bool)

func (*Domain) Name

func (d *Domain) Name() string

type GEOIP

type GEOIP struct {
	Action map[string]*Action
	Mmdb   *geoip2.Reader
}

func NewRuleGEOIP

func NewRuleGEOIP(path string) *GEOIP

func (*GEOIP) Empty

func (g *GEOIP) Empty() bool

func (*GEOIP) Insert

func (g *GEOIP) Insert(a ...any) error

func (*GEOIP) Match

func (g *GEOIP) Match(m message.Metadata, others ...any) (*Action, bool)

func (*GEOIP) Name

func (g *GEOIP) Name() string

type PrgName

type PrgName map[string]*Action

func NewRulePrgName

func NewRulePrgName() *PrgName

func (*PrgName) Empty

func (r *PrgName) Empty() bool

func (*PrgName) Insert

func (r *PrgName) Insert(a ...any) error

func (*PrgName) Match

func (r *PrgName) Match(m message.Metadata, others ...any) (*Action, bool)

func (*PrgName) Name

func (r *PrgName) Name() string

type PrgPath

type PrgPath map[string]*Action

func NewRulePrgPath

func NewRulePrgPath() *PrgPath

func (*PrgPath) Empty

func (r *PrgPath) Empty() bool

func (*PrgPath) Insert

func (r *PrgPath) Insert(a ...any) error

func (*PrgPath) Match

func (r *PrgPath) Match(m message.Metadata, others ...any) (*Action, bool)

func (*PrgPath) Name

func (r *PrgPath) Name() string

type Route

type Route map[string]*Action

func NewRuleRoute

func NewRuleRoute() *Route

func (*Route) Empty

func (r *Route) Empty() bool

func (*Route) Insert

func (r *Route) Insert(a ...any) error

func (*Route) Match

func (r *Route) Match(m message.Metadata, others ...any) (*Action, bool)

func (*Route) Name

func (r *Route) Name() string

type Rule

type Rule interface {
	Name() string
	Match(message.Metadata, ...any) (*Action, bool)
	Insert(...any) error
	Empty() bool
}

Jump to

Keyboard shortcuts

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