notifier

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

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

func NewNotifier

func NewNotifier(cfg *types.Config) *Notifier

func (*Notifier) AddNode

func (n *Notifier) AddNode(nodeID types.NodeID, c chan<- types.StateUpdate)

func (*Notifier) Close

func (n *Notifier) Close()

Close stops the batcher and closes all channels.

func (*Notifier) IsConnected

func (n *Notifier) IsConnected(nodeID types.NodeID) bool

IsConnected reports if a node is connected to headscale and has a poll session open.

func (*Notifier) IsLikelyConnected

func (n *Notifier) IsLikelyConnected(nodeID types.NodeID) bool

IsLikelyConnected reports if a node is connected to headscale and has a poll session open, but doesnt lock, so might be wrong.

func (*Notifier) LikelyConnectedMap

func (n *Notifier) LikelyConnectedMap() *xsync.MapOf[types.NodeID, bool]

func (*Notifier) NotifyAll

func (n *Notifier) NotifyAll(ctx context.Context, update types.StateUpdate)

func (*Notifier) NotifyByNodeID

func (n *Notifier) NotifyByNodeID(
	ctx context.Context,
	update types.StateUpdate,
	nodeID types.NodeID,
)

func (*Notifier) NotifyWithIgnore

func (n *Notifier) NotifyWithIgnore(
	ctx context.Context,
	update types.StateUpdate,
	ignoreNodeIDs ...types.NodeID,
)

func (*Notifier) RemoveNode

func (n *Notifier) RemoveNode(nodeID types.NodeID, c chan<- types.StateUpdate) bool

RemoveNode removes a node and a given channel from the notifier. It checks that the channel is the same as currently being updated and ignores the removal if it is not. RemoveNode reports if the node/chan was removed.

func (*Notifier) String

func (n *Notifier) String() string

Jump to

Keyboard shortcuts

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