rules

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseRules

func BaseRules(b RuleSetBuilder)

Adds a set of base rules to the builder. When this is used, priorities [0, 10) and [990, 1000) should be assumed reserved.

TODO: Document these rules a bit.

Types

type Rule

type Rule string

A rule, probably of the iptables variety, although nothing about the value is assumed in this package.

type RuleSet

type RuleSet []Rule

A set of rules to be applied in order.

type RuleSetBuilder

type RuleSetBuilder map[int][]Rule

Maps a set of priorities to rules at those priorities. Some rules exported here will have "special" priorities that can be depended upon. Rules should be applied from the lowest numbered slice (highest priority) to the highest numbered slice (highest priority).

func NewBuilder

func NewBuilder() RuleSetBuilder

func (RuleSetBuilder) Add

func (b RuleSetBuilder) Add(priority int, rules RuleSet) RuleSetBuilder

func (RuleSetBuilder) Apply

func (b RuleSetBuilder) Apply(mutate func(b RuleSetBuilder)) RuleSetBuilder

func (RuleSetBuilder) Build

func (b RuleSetBuilder) Build() RuleSet

Jump to

Keyboard shortcuts

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