Movatterモバイル変換


[0]ホーム

URL:


netlogtype

package
v1.92.2Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License:BSD-3-ClauseImports:6Imported by:21

Details

Repository

github.com/tailscale/tailscale

Links

Documentation

Overview

Package netlogtype defines types for network logging.

Index

Constants

View Source
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.

func (Counts)Add

func (c1Counts) Add(c2Counts)Counts

Add adds the counts from both c1 and c2.

func (Counts)IsZero

func (cCounts) IsZero()bool

typeCountsByConnectionadded 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)Addadded 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)Cloneadded inv1.90.0

func (c *CountsByConnection) Clone() map[Connection]Counts

Clone deep copies the map.

func (*CountsByConnection)Resetadded 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.

typeNodeadded 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.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp