Documentation ¶
Index ¶
Constants ¶
View Source
const ( // FlowUnknown are unknown flow. FlowUnknown FlowDirection = 1 << iota // FlowActive are 'active open'. FlowActive // FlowPassive are 'passive open' FlowPassive FilterAll = "all" FilterPublic = "public" FilterPrivate = "private" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddrPort ¶
type AddrPort struct { Name string `json:"name"` Addr string `json:"addr"` Port string `json:"port"` }
AddrPort are <addr>:<port>
type FlowDirection ¶
type FlowDirection int
FlowDirection are bitmask that represents both Active or Passive.
func (FlowDirection) MarshalJSON ¶ added in v0.2.0
func (c FlowDirection) MarshalJSON() ([]byte, error)
MarshalJSON returns human readable `mode` format.
func (FlowDirection) String ¶ added in v0.3.0
func (c FlowDirection) String() string
String returns string representation.
type GetHostFlowsOption ¶ added in v0.5.4
GetHostFlowsOption represens an option for func GetHostFlows().
type HostFlow ¶
type HostFlow struct { Direction FlowDirection `json:"direction"` Local *AddrPort `json:"local"` Peer *AddrPort `json:"peer"` Connections int64 `json:"connections"` Process *Process `json:"process,omitempty"` }
HostFlow represents a `host flow`.
type HostFlows ¶
HostFlows represents a group of host flow by unique key.
func GetHostFlows ¶
func GetHostFlows(opt *GetHostFlowsOption) (HostFlows, error)
GetHostFlows gets host flows by netlink, and try to get by procfs if it fails.
func GetHostFlowsByNetlink ¶ added in v0.4.2
func GetHostFlowsByNetlink(opt *GetHostFlowsOption) (HostFlows, error)
GetHostFlowsByNetlink gets host flows by Linux netlink API.
func GetHostFlowsByProcfs ¶ added in v0.4.2
GetHostFlowsByProcfs gets host flows from procfs.
func (HostFlows) MarshalJSON ¶ added in v0.2.0
MarshalJSON converts map into list.
Click to show internal directories.
Click to hide internal directories.