rules

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRule

func InitRule(idx int, rule *Rule) error

Types

type Config

type Config struct {
	Version int     `yaml:"version"`
	Rules   []*Rule `yaml:"rules"`
}

type Rule

type Rule struct {
	Match  string `yaml:"match"`
	Type   string `yaml:"type"`
	Target string `yaml:"target,omitempty"`
	Name   string `yaml:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*Rule) String

func (r *Rule) String() string

type RuleType

type RuleType int
const (
	Rewrite RuleType = iota
	ProxyTCP
	LogTCP
	LogHTTP
	UserConnHandler
	Drop
	PassThrough
)

type Rules

type Rules []*Rule

func ParseRuleSpec

func ParseRuleSpec(file *os.File) (Rules, error)

func (Rules) Match

func (rs Rules) Match(network string, srcAddr, dstAddr net.Addr) (*Rule, error)

Jump to

Keyboard shortcuts

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