discovery

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package discovery provides network discovery functionality using nmap. This package handles host discovery operations and integrates with the database for proper target generation and result storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Networks    []string      `json:"networks"`
	Network     string        `json:"network"`
	Method      string        `json:"method"`
	DetectOS    bool          `json:"detect_os"`
	Timeout     time.Duration `json:"timeout"`
	Concurrency int           `json:"concurrency"`
	MaxHosts    int           `json:"max_hosts"`
}

Config holds discovery configuration parameters.

type Engine

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

Engine handles network discovery operations.

func NewEngine

func NewEngine(database *db.DB) *Engine

NewEngine creates a new discovery engine with the given database.

func (*Engine) Discover

func (e *Engine) Discover(ctx context.Context, config *Config) (*db.DiscoveryJob, error)

Discover performs network discovery on the specified network.

func (*Engine) SetConcurrency

func (e *Engine) SetConcurrency(concurrency int)

SetConcurrency sets the concurrency level for discovery operations.

func (*Engine) SetTimeout

func (e *Engine) SetTimeout(timeout time.Duration)

SetTimeout sets the timeout for discovery operations.

func (*Engine) WaitForCompletion

func (e *Engine) WaitForCompletion(ctx context.Context, jobID uuid.UUID, timeout time.Duration) error

WaitForCompletion waits for a discovery job to complete or timeout.

type Result

type Result struct {
	IPAddress    net.IP        `json:"ip_address"`
	Status       string        `json:"status"`
	ResponseTime time.Duration `json:"response_time"`
	OSInfo       string        `json:"os_info"`
	Method       string        `json:"method"`
	Error        string        `json:"error,omitempty"`
}

Result represents a discovery result for a single host.

Jump to

Keyboard shortcuts

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