store

package
v0.0.0-...-8938f7c Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2015 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 Connection

type Connection struct {
	Protocol string `json:"protocol"`
	SrcPort  uint16 `json:"src_port"`
	DestHost string `json:"dst_host"`
	DestPort uint16 `json:"dst_port"`
	Totals   Entry  `json:"totals"`
}

type Device

type Device struct {
	Name            string `json:"name"`
	MacAddress      string `json:"mac_address"`
	IpAddress       string `json:"ip_address"`
	ConnectionCount int    `json:"connection_count"`
	Totals          Entry  `json:"totals"`
	Rate5Sec        Entry  `json:"rate_5sec"`
}

type DeviceDetails

type DeviceDetails struct {
	Device
	Connections []*Connection `json:"connections"`
}

type Entry

type Entry struct {
	BytesIn    uint64 `json:"bytes_in"`
	PacketsIn  uint64 `json:"packets_in"`
	BytesOut   uint64 `json:"bytes_out"`
	PacketsOut uint64 `json:"packets_out"`
}

type Rates

type Rates struct {
	Rate5Sec Entry `json:"rate_5sec"`
}

type Span

type Span struct {
	Start      time.Time `json:"start"`
	End        time.Time `json:"end"`
	CurrentIdx int       `json:"current_idx"`
	Max        Entry     `json:"max"`
	Deltas     []Entry   `json:"deltas"`
}

type Store

type Store interface {
	Devices() []*Device
	DeviceDetails(deviceIp string) *DeviceDetails
	DeviceSpan(deviceIp string) *Span
	TotalsSpan() *Span
	TotalsRates() *Rates
	Stop()
}

func NewStore

func NewStore(config *config.StoreConfig, conntrackProvider conntrack.Provider, dhcpProvicer dhcp.Provider, parent logging.Logger) (Store, error)

Jump to

Keyboard shortcuts

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