netlogtype
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package netlogtype defines types for network logging.
Index¶
Constants¶
const (// MinMessageJSONSize is the overhead size of Message when it is// serialized as JSON assuming that each field is minimally populated.// Each [Node] occupies at least [MinNodeJSONSize].// Each [ConnectionCounts] occupies at most [MaxConnectionCountsJSONSize].MinMessageJSONSize =len(messageJSON)// MaxConnectionCountsJSONSize is the maximum size of a ConnectionCounts// when it is serialized as JSON, assuming no superfluous whitespace.// It does not include the trailing comma that often appears when// this object is nested within an array.// It assumes that netip.Addr never has IPv6 zones.MaxConnectionCountsJSONSize =len(maxJSONConnCounts))
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeConnection¶
type Connection struct {Protoipproto.Proto `json:"proto,omitzero"`Srcnetip.AddrPort `json:"src,omitzero"`Dstnetip.AddrPort `json:"dst,omitzero"`}Connection is a 5-tuple of proto, source and destination IP and port.
func (Connection)IsZero¶
func (cConnection) IsZero()bool
typeConnectionCounts¶
type ConnectionCounts struct {ConnectionCounts}ConnectionCounts is a flattened struct of both a connection and counts.
typeCounts¶
type Counts struct {TxPacketsuint64 `json:"txPkts,omitzero"`TxBytesuint64 `json:"txBytes,omitzero"`RxPacketsuint64 `json:"rxPkts,omitzero"`RxBytesuint64 `json:"rxBytes,omitzero"`}Counts are statistics about a particular connection.
typeCountsByConnection¶added inv1.90.0
type CountsByConnection struct {// contains filtered or unexported fields}CountsByConnection is a count of packets and bytes for each connection.All methods are safe for concurrent calls.
func (*CountsByConnection)Add¶added inv1.90.0
func (c *CountsByConnection) Add(protoipproto.Proto, src, dstnetip.AddrPort, packets, bytesint, recvbool)
Add adds packets and bytes for the specified connection.
func (*CountsByConnection)Clone¶added inv1.90.0
func (c *CountsByConnection) Clone() map[Connection]Counts
Clone deep copies the map.
func (*CountsByConnection)Reset¶added inv1.90.0
func (c *CountsByConnection) Reset()
Reset clear the map.
typeMessage¶
type Message struct {NodeIDtailcfg.StableNodeID `json:"nodeId"`// e.g., "n123456CNTRL"Starttime.Time `json:"start"`// inclusiveEndtime.Time `json:"end"`// inclusiveSrcNodeNode `json:"srcNode,omitzero"`DstNodes []Node `json:"dstNodes,omitempty"`VirtualTraffic []ConnectionCounts `json:"virtualTraffic,omitempty"`SubnetTraffic []ConnectionCounts `json:"subnetTraffic,omitempty"`ExitTraffic []ConnectionCounts `json:"exitTraffic,omitempty"`PhysicalTraffic []ConnectionCounts `json:"physicalTraffic,omitempty"`}Message is the log message that captures network traffic.
typeNode¶added inv1.92.0
type Node struct {// NodeID is the stable ID of the node.NodeIDtailcfg.StableNodeID `json:"nodeId"`// Name is the fully-qualified name of the node.Namestring `json:"name,omitzero"`// e.g., "carbonite.example.ts.net"// Addresses are the Tailscale IP addresses of the node.Addresses []netip.Addr `json:"addresses,omitempty"`// OS is the operating system of the node.OSstring `json:"os,omitzero"`// e.g., "linux"// User is the user that owns the node.// It is not populated if the node is tagged.Userstring `json:"user,omitzero"`// e.g., "johndoe@example.com"// Tags are the tags of the node.// It is not populated if the node is owned by a user.Tags []string `json:"tags,omitempty"`// e.g., ["tag:prod","tag:logs"]}Node is information about a node.