Documentation ¶
Index ¶
- type Notifier
- func (n *Notifier) AddNode(nodeID types.NodeID, c chan<- types.StateUpdate)
- func (n *Notifier) Close()
- func (n *Notifier) IsConnected(nodeID types.NodeID) bool
- func (n *Notifier) IsLikelyConnected(nodeID types.NodeID) bool
- func (n *Notifier) LikelyConnectedMap() *xsync.MapOf[types.NodeID, bool]
- func (n *Notifier) NotifyAll(ctx context.Context, update types.StateUpdate)
- func (n *Notifier) NotifyByNodeID(ctx context.Context, update types.StateUpdate, nodeID types.NodeID)
- func (n *Notifier) NotifyWithIgnore(ctx context.Context, update types.StateUpdate, ignoreNodeIDs ...types.NodeID)
- func (n *Notifier) RemoveNode(nodeID types.NodeID, c chan<- types.StateUpdate) bool
- func (n *Notifier) String() string
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 (*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 ¶
IsConnected reports if a node is connected to headscale and has a poll session open.
func (*Notifier) IsLikelyConnected ¶
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 (*Notifier) NotifyAll ¶
func (n *Notifier) NotifyAll(ctx context.Context, update types.StateUpdate)
func (*Notifier) NotifyByNodeID ¶
func (*Notifier) NotifyWithIgnore ¶
func (*Notifier) RemoveNode ¶
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.
Click to show internal directories.
Click to hide internal directories.