tunnelstate

package
v0.0.0-...-2714d10 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnTracker

type ConnTracker struct {
	// contains filtered or unexported fields
}

func NewConnTracker

func NewConnTracker(
	log *zerolog.Logger,
) *ConnTracker

func (*ConnTracker) CountActiveConns

func (ct *ConnTracker) CountActiveConns() uint

func (*ConnTracker) GetActiveConnections

func (ct *ConnTracker) GetActiveConnections() []IndexedConnectionInfo

Returns the connection information iff it is connected this also leverages the IndexedConnectionInfo to also provide the connection index

func (*ConnTracker) HasConnectedWith

func (ct *ConnTracker) HasConnectedWith(protocol connection.Protocol) bool

HasConnectedWith checks if we've ever had a successful connection to the edge with said protocol.

func (*ConnTracker) OnTunnelEvent

func (ct *ConnTracker) OnTunnelEvent(c connection.Event)

type ConnectionInfo

type ConnectionInfo struct {
	IsConnected bool                `json:"isConnected,omitempty"`
	Protocol    connection.Protocol `json:"protocol,omitempty"`
	EdgeAddress net.IP              `json:"edgeAddress,omitempty"`
}

type IndexedConnectionInfo

type IndexedConnectionInfo struct {
	ConnectionInfo
	Index uint8 `json:"index,omitempty"`
}

Convinience struct to extend the connection with its index.

Jump to

Keyboard shortcuts

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