appnetstat

package
v0.0.0-...-823f68f Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectData

type ConnectData struct {
	Infos  []ConnectInfo
	States []ConnectState
}

type ConnectInfo

type ConnectInfo struct {
	ID       string
	Command  string // top
	Pid      int    // 77
	User     string // ?
	Protocol string // TCP
	Port     int    // 40349
}

type ConnectState

type ConnectState struct {
	ID       string
	Protocol string // tcp
	State    string // listen
}

type ErrCannotParseInput

type ErrCannotParseInput struct {
	Input string
}

func (*ErrCannotParseInput) Error

func (e *ErrCannotParseInput) Error() string

type Logger

type Logger interface {
	Debug(msg string)
	Info(msg string)
	Warn(msg string)
	Error(msg string)
}

type NetStatParser

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

func (*NetStatParser) Parse

func (t *NetStatParser) Parse(in string) []NetStatRow

type NetStatRow

type NetStatRow struct {
	Proto, LocalAddr, ForeignAddr, State, Programm string
	RecvQ, SendQ, PID, LocalPort, ForeignPort      int
}

type NetstatRunner

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

func New

func New(commandPath string, logg Logger, parser Parser) *NetstatRunner

func (*NetstatRunner) Run

func (t *NetstatRunner) Run(ctx context.Context, warmingUpTime, shapshotPeriod int) chan ConnectData

type Parser

type Parser interface {
	Parse(in string) []NetStatRow
}

func NewParser

func NewParser(logg Logger) Parser

Jump to

Keyboard shortcuts

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