apptcpdump

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 Parser

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

type TCPDumpLine

type TCPDumpLine struct {
	Time                                time.Time
	Type, Protocol, Source, Destination string
	Bytes                               int
}

type TCPDumpParser

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

func NewParser

func NewParser(logg Logger) *TCPDumpParser

func (*TCPDumpParser) Parse

func (t *TCPDumpParser) Parse(in string) []TCPDumpLine

type TCPDumpRunner

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

func New

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

func (*TCPDumpRunner) Run

func (t *TCPDumpRunner) Run(ctx context.Context, warmingUpTime, snapshotPeriod int) chan TopTalkers

type TopTalkerByProtocol

type TopTalkerByProtocol struct {
	Protocol string // UDP
	Bytes    int    // 127
	Percent  string // 32%
}

type TopTalkerByTraffic

type TopTalkerByTraffic struct {
	Source         string  // 172.21.0.1.52978
	Destination    string  // 239.255.255.250.1900
	Protocol       string  // udp
	BytesPerSecond float32 // 173 ?
}

type TopTalkers

type TopTalkers struct {
	ByProtocol []TopTalkerByProtocol
	ByTraffic  []TopTalkerByTraffic
}

Jump to

Keyboard shortcuts

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