ports

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllPorts added in v0.8.0

func AllPorts() []int

AllPorts returns all ports 1-65535.

func DefaultPorts

func DefaultPorts() []int

func FormatDefault added in v0.8.0

func FormatDefault() string

FormatDefault returns the default ports as a compact string (e.g. "22,80,443").

func NormalizeCustom

func NormalizeCustom(raw string) (string, error)

NormalizeCustom returns a normalized CSV list for custom ports: valid tokens only, duplicates removed, and range tokens preserved.

func ParseList

func ParseList(raw string) ([]int, error)

func SaveConfig

func SaveConfig(name string, cfg Config) error

SaveConfig saves port configuration by name (e.g. "ports", "target")

Types

type Config

type Config struct {
	Mode   string `json:"mode"`
	Custom string `json:"custom"`
}

func LoadConfig

func LoadConfig(name string) (Config, error)

LoadConfig loads port configuration by name (e.g. "ports", "target")

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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