netstat

package
v1.104.5 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: BSD-3-Clause Imports: 3 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package netstat returns the local machine's network connection table.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = errors.New("not implemented for GOOS=" + runtime.GOOS)

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Local, Remote netip.AddrPort
	Pid           int
	State         string // TODO: type?
	OSMetadata    OSMetadata
}

type OSMetadata added in v1.36.0

type OSMetadata struct{}

OSMetadata includes any additional OS-specific information that may be obtained during the retrieval of a given Entry.

type Table

type Table struct {
	Entries []Entry
}

Table contains local machine's TCP connection entries.

Currently only TCP (IPv4 and IPv6) are included.

func Get

func Get() (*Table, error)

Get returns the connection table.

It returns ErrNotImplemented if the table is not available for the current operating system.

Jump to

Keyboard shortcuts

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