cmd

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package cmd contains the core application logic and goroutine launch points.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPURLSlug

func HTTPURLSlug(domain, path string) string

HTTPURLSlug reduces the path down to only its first element iff the path exists. Maintains the base / for all URLs which do not contain a section.

Types

type Banken

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

Banken 番犬 App manages launching consumers of network traffic data as well as the data storage structures. After startup it operates updating the UI data structures from the models.

func NewBanken

func NewBanken(ctx context.Context, at, topN int, bpf string, logger *log.Logger) *Banken

NewBanken initiates instance with at:AlertThreshold, topN: Top N(umber) of URLs to display, and bpf (filter) string to configure packet capture.

func (*Banken) Init

func (b *Banken) Init(topN, reqCnts, alerts *widgets.List) ([]string, chan sniff.HTTPXPacket, error)

Init launches all consumers of the collected packet data models, then logs and updates the UI with http traffic status.

func (*Banken) Run

func (b *Banken) Run(ifaces []string, packetStream chan sniff.HTTPXPacket)

Run initializes traffic capture for each interface, feeding data to analysis models.

type ReqCount

type ReqCount struct {
	URL string
	C   uint64
}

ReqCount links URLs to their request occurrence count:C.

Jump to

Keyboard shortcuts

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