onf

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2019 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ONF

type ONF struct {
	Raw       string   // raw string that produced this result
	Cmd       string   // command associated with Pid
	Pid       int      // pid of the owner
	Src       net.Addr // source address
	Dst       net.Addr // destination address
	CreatedAt time.Time
}

ONF represents an open network file.

func FetchAll

func FetchAll() ([]ONF, error)

FetchAll retrieves the complete list of open network files. It does so using an external tool, `netstat` for windows and `lsof` for unix based systems.

func Filter

func Filter(set []ONF, pivot string) ([]ONF, error)

Filter takes `pivot` and creates a compiled regex out of it. It then uses it to filter `set`, removing every open network file that do not match. If an error occurs, it is returned together with the original list.

func (ONF) String

func (f ONF) String() string

Jump to

Keyboard shortcuts

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