engines

package
v0.0.0-...-37b34e5 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: GPL-3.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 DefaultEngine

type DefaultEngine struct {
	Monitor netlink.NetlinkWatcher
	Errors  <-chan error
	Lock    *sync.Mutex
	// contains filtered or unexported fields
}

func (*DefaultEngine) CreateChain

func (e *DefaultEngine) CreateChain()

func (*DefaultEngine) CreateRule

func (e *DefaultEngine) CreateRule()

func (*DefaultEngine) CreateTable

func (e *DefaultEngine) CreateTable()

func (*DefaultEngine) DeleteChain

func (e *DefaultEngine) DeleteChain()

func (*DefaultEngine) DeleteRule

func (e *DefaultEngine) DeleteRule()

func (*DefaultEngine) DeleteTable

func (e *DefaultEngine) DeleteTable()

func (*DefaultEngine) Start

func (e *DefaultEngine) Start() error

Start starts the execution of the rules engine

func (*DefaultEngine) Stop

func (e *DefaultEngine) Stop() error

Stop stops the execution of the rules engine

func (*DefaultEngine) UpdateRule

func (e *DefaultEngine) UpdateRule()

type Engine

type Engine interface {
	Start() error
	Stop() error
}

func NewEngine

func NewEngine(options ...EngineOptions) (engine Engine, err error)

type EngineOptions

type EngineOptions func(options *engineOptions)

EngineOptions defines a generic function that takes and modifies the listOptions struct

func WithChangeNotify

func WithChangeNotify(notifyChan chan<- struct{}) EngineOptions

WithChangeNotify adds a channel that the engine can send update triggers on. For this to work you must provide a monitor in addition to the trigger as this will only trigger on external changes, not changes that are made via this library.

func WithMonitor

func WithMonitor(monitor netlink.NetlinkWatcher) EngineOptions

WithMonitor adds a Netlink Monitor to the engineOptions. This allows the engine to monitor changes to the nftables configuration in realtime which allows it to update the rule state and send notifications.

Jump to

Keyboard shortcuts

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