status

package
v0.11.6 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FullStatus

type FullStatus struct {
	Peers           []PeerState
	ManagementState ManagementState
	SignalState     SignalState
	LocalPeerState  LocalPeerState
}

FullStatus contains the full state held by the Status instance

type LocalPeerState

type LocalPeerState struct {
	IP              string
	PubKey          string
	KernelInterface bool
	FQDN            string
}

LocalPeerState contains the latest state of the local peer

type ManagementState

type ManagementState struct {
	URL       string
	Connected bool
}

ManagementState contains the latest state of a management connection

type PeerState

type PeerState struct {
	IP                     string
	PubKey                 string
	FQDN                   string
	ConnStatus             string
	ConnStatusUpdate       time.Time
	Relayed                bool
	Direct                 bool
	LocalIceCandidateType  string
	RemoteIceCandidateType string
}

PeerState contains the latest state of a peer

type SignalState

type SignalState struct {
	URL       string
	Connected bool
}

SignalState contains the latest state of a signal connection

type Status

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

Status holds a state of peers, signal and management connections

func NewRecorder

func NewRecorder() *Status

NewRecorder returns a new Status instance

func (*Status) AddPeer

func (d *Status) AddPeer(peerPubKey string) error

AddPeer adds peer to Daemon status map

func (*Status) CleanLocalPeerState

func (d *Status) CleanLocalPeerState()

CleanLocalPeerState cleans local peer status

func (*Status) GetFullStatus

func (d *Status) GetFullStatus() FullStatus

GetFullStatus gets full status

func (*Status) GetPeer added in v0.9.0

func (d *Status) GetPeer(peerPubKey string) (PeerState, error)

GetPeer adds peer to Daemon status map

func (*Status) GetPeerStateChangeNotifier added in v0.9.0

func (d *Status) GetPeerStateChangeNotifier(peer string) <-chan struct{}

GetPeerStateChangeNotifier returns a change notifier channel for a peer

func (*Status) MarkManagementConnected

func (d *Status) MarkManagementConnected(managementURL string)

MarkManagementConnected sets ManagementState to connected

func (*Status) MarkManagementDisconnected

func (d *Status) MarkManagementDisconnected(managementURL string)

MarkManagementDisconnected sets ManagementState to disconnected

func (*Status) MarkSignalConnected

func (d *Status) MarkSignalConnected(signalURL string)

MarkSignalConnected sets SignalState to connected

func (*Status) MarkSignalDisconnected

func (d *Status) MarkSignalDisconnected(signalURL string)

MarkSignalDisconnected sets SignalState to disconnected

func (*Status) RemovePeer

func (d *Status) RemovePeer(peerPubKey string) error

RemovePeer removes peer from Daemon status map

func (*Status) UpdateLocalPeerState

func (d *Status) UpdateLocalPeerState(localPeerState LocalPeerState)

UpdateLocalPeerState updates local peer status

func (*Status) UpdatePeerFQDN added in v0.11.2

func (d *Status) UpdatePeerFQDN(peerPubKey, fqdn string) error

UpdatePeerFQDN update peer's state fqdn only

func (*Status) UpdatePeerState

func (d *Status) UpdatePeerState(receivedState PeerState) error

UpdatePeerState updates peer status

Jump to

Keyboard shortcuts

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