netstat

package
v1.58.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: BSD-3-Clause Imports: 3 Imported by: 2

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