rules

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Version int   `yaml:"version"`
	Rules   Rules `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 (
	UserConnHandler RuleType = iota
	Drop
)

type Rules

type Rules []*Rule

func Init added in v1.0.1

func Init(file io.Reader) (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