model

package
v0.0.0-...-27598f0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flow

type Flow struct {
	ID       uuid.UUID `bigquery:"id" json:"id"`
	Protocol string    `bigquery:"protocol" json:"protocol"`
	Src      Peer      `bigquery:"src" json:"src"`
	Dst      Peer      `bigquery:"dst" json:"dst"`

	FirstSeenAt time.Time `bigquery:"first_seen_at"`
	LastSeenAt  time.Time `bigquery:"last_seen_at" json:"last_seen_at"`

	SrcStat PeerStat `bigquery:"src_stat" json:"src_stat"`
	DstStat PeerStat `bigquery:"dst_stat" json:"dst_stat"`
	Status  string   `bigquery:"status" json:"status"`
}

func NewFlow

func NewFlow(src, dst Peer, proto string, now time.Time, stat PeerStat) *Flow

func (*Flow) Key

func (x *Flow) Key() FlowKey

func (*Flow) Update

func (x *Flow) Update(src *Peer, now time.Time, stat PeerStat)

type FlowBase

type FlowBase struct {
}

type FlowKey

type FlowKey uint64

func CalcFlowKey

func CalcFlowKey(p1, p2 *Peer, proto string) FlowKey

type Peer

type Peer struct {
	Addr net.IP `bigquery:"addr" json:"addr"`
	Port uint32 `bigquery:"port" json:"port"`
}

func (Peer) Equal

func (x Peer) Equal(y *Peer) bool

type PeerStat

type PeerStat struct {
	Bytes   uint64 `bigquery:"bytes" json:"bytes"`
	Packets uint64 `bigquery:"packets" json:"packets"`
}

func (*PeerStat) Add

func (x *PeerStat) Add(y *PeerStat)

type Record

type Record struct {
	FlowLogs []*Flow
}

type Tick

type Tick int64

Jump to

Keyboard shortcuts

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