config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDenyPorts = []string{
	"22",
	"25",
	"135-139",
	"445",
	"3389",
	"5900",
}

Functions

func ValidatePort

func ValidatePort(port int) error

Types

type Config

type Config struct {
	ListenAddr string

	CertPath string
	KeyPath  string

	SelfSigned bool

	DenyPorts  []PortRange
	AllowRange PortRange

	Verbose   bool
	AccessLog bool

	ReadHeaderTimeout int
	IdleTimeout       int
	WriteTimeout      int
	DialTimeout       int
}

func DefaultConfig

func DefaultConfig() *Config

func (*Config) IsPortAllowed

func (c *Config) IsPortAllowed(port int) bool

func (*Config) LoadFromEnv

func (c *Config) LoadFromEnv()

func (*Config) Validate

func (c *Config) Validate() error

type PortRange

type PortRange struct {
	Start int
	End   int
}

func ParsePortRange

func ParsePortRange(s string) (PortRange, error)

func ParsePortRanges

func ParsePortRanges(s string) ([]PortRange, error)

func (PortRange) Contains

func (pr PortRange) Contains(port int) bool

func (PortRange) String

func (pr PortRange) String() string

Jump to

Keyboard shortcuts

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