status

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 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
}

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
	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) 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) 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