configuration

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 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 Configuration

type Configuration struct {
	Logging    LoggingConfig
	Global     GlobalConfig `yaml:"global" json:"global"`
	Interfaces []InterfaceConfig
	Log        *log.Entry `yaml:"-" json:"-"`
	// contains filtered or unexported fields
}

func New

func New(path string, jsonFormat bool) (*Configuration, error)

func (*Configuration) Read

func (c *Configuration) Read() error

type GlobalConfig added in v1.0.1

type GlobalConfig struct {
	BlockByIDN            bool     `yaml:"block_by_idn" json:"block_by_idn"`
	BlockListString       []string `yaml:"block" json:"block"`
	BlockList             domains.DomainTree
	ConnectAllowHighPorts bool `yaml:"connect_allow_high_ports" json:"connect_allow_high_ports"`
	ConnectAllowLowPorts  bool `yaml:"connect_allow_low_ports" json:"connect_allow_low_ports"`
}

type InterfaceConfig

type InterfaceConfig struct {
	Name                   string
	Bind                   string
	BindIP                 net.IP `yaml:"-" json:"-"`
	BindPort               uint16 `yaml:"-" json:"-"`
	Proxy                  string
	ProxyIP                net.IP      `yaml:"-" json:"-"`
	ProxyPort              uint16      `yaml:"-" json:"-"`
	EnableProxy            bool        `yaml:"-" json:"-"`
	NetworkStrings         []string    `yaml:"networks" json:"networks"`
	InterfaceNetworkDirect bool        `yaml:"direct" json:"direct"`
	Networks               []net.IPNet `yaml:"-" json:"-"`
	Regexp                 []string
	BlockListString        []string `yaml:"block" json:"block"`
	BlockList              domains.DomainTree
	ReverseProxy           map[string]ReverseConfig `yaml:"reverse_proxy" json:"reverse_proxy"`
}

type LoggingConfig

type LoggingConfig struct {
	File  string `yaml:"file" json:"log"`
	Level string
}

type ReverseConfig

type ReverseConfig struct {
	Destination     string
	DestinationIp   net.IP `yaml:"-" json:"-"`
	DestinationPort uint16 `yaml:"-" json:"-"`
	SourceInterface string `yaml:"source_interface" json:"source_interface"`
	SourceIP        net.IP `yaml:"-" json:"-"`
}

Jump to

Keyboard shortcuts

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