scanner

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDialTimeout = 500 * time.Millisecond
View Source
const DefaultWorkerCount = 1024

Variables

This section is empty.

Functions

func WithDialTimeout

func WithDialTimeout(timeout time.Duration) func(config *Config)

func WithWorkerCount

func WithWorkerCount(workerCount int) func(config *Config)

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

type Option

type Option func(config *Config)

type PortRange

type PortRange struct {
	Start uint16
	End   uint16
}

type Printer

type Printer struct {
	// contains filtered or unexported fields
}

func NewPrinter

func NewPrinter(total uint16) *Printer

func (*Printer) OutputFinalStats

func (p *Printer) OutputFinalStats(opened, closed uint16, elapsed float64)

func (*Printer) OutputInitialText

func (p *Printer) OutputInitialText(host string, ports string)

func (*Printer) OutputPort

func (p *Printer) OutputPort(port uint16, open bool)

type ScannedPort

type ScannedPort struct {
	Port   uint16
	Opened bool
}

type Scanner

type Scanner struct {
	Stats Stats
	// contains filtered or unexported fields
}

func NewScanner

func NewScanner(host, ports string, options ...Option) (*Scanner, error)

func (*Scanner) Scan

func (s *Scanner) Scan(p *Printer) ([]ScannedPort, error)

type Stats

type Stats struct {
	Total  uint16
	Opened uint16
	Closed uint16
}

Jump to

Keyboard shortcuts

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