Documentation
¶
Index ¶
- func NotHandled()
- type DiscoveryState
- func (s *DiscoveryState) ActionLeave() bool
- func (h *DiscoveryState) ActionStartChRo()
- func (h *DiscoveryState) ActionSync()
- func (h *DiscoveryState) ChRoIdReceived(sender common.PeerAddr, id int)
- func (s *DiscoveryState) Init()
- func (h *DiscoveryState) LeaderChanged(sender common.PeerAddr, leader common.PeerAddr, value int)
- func (h *DiscoveryState) Name() string
- func (h *DiscoveryState) NewPeer(sender common.PeerAddr, addr common.PeerAddr, name string, shouldReply bool)
- func (s *DiscoveryState) PeerRemoved(sender common.PeerAddr, removedPeer common.PeerAddr, direction int)
- func (h *DiscoveryState) Ping(sender common.PeerAddr, source common.PeerAddr)
- func (h *DiscoveryState) Pong(sender common.PeerAddr, source common.PeerAddr)
- func (h *DiscoveryState) SyncPeers(sender common.PeerAddr, values []string)
- type LeaderState
- func (s *LeaderState) ActionGetValue()
- func (s *LeaderState) ActionLeave() bool
- func (s *LeaderState) ActionReportPeer(addr common.PeerAddr)
- func (s *LeaderState) ActionSetValue(value int)
- func (s *LeaderState) ActionStartChRo()
- func (s *LeaderState) ActionSync()
- func (s *LeaderState) DistanceReceived(sender common.PeerAddr, distance int, direction int)
- func (s *LeaderState) DistanceRequested(sender common.PeerAddr, source common.PeerAddr)
- func (s *LeaderState) EmitDistanceBroadcast()
- func (s *LeaderState) Init()
- func (s *LeaderState) LeaderChanged(sender common.PeerAddr, leader common.PeerAddr, value int)
- func (s *LeaderState) Name() string
- func (s *LeaderState) NewPeer(sender common.PeerAddr, addr common.PeerAddr, name string, shouldReply bool)
- func (s *LeaderState) PeerRemoved(sender common.PeerAddr, reportedPeer common.PeerAddr, direction int)
- func (s *LeaderState) PeerReported(reportedPeer common.PeerAddr)
- func (s *LeaderState) ValueGetRequested(sender common.PeerAddr, source common.PeerAddr)
- func (s *LeaderState) ValueSetRequested(sender common.PeerAddr, source common.PeerAddr, value int)
- type LinkedState
- func (s *LinkedState) ActionGetValue()
- func (s *LinkedState) ActionLeave() bool
- func (s *LinkedState) ActionReportPeer(addr common.PeerAddr)
- func (s *LinkedState) ActionSetValue(value int)
- func (s *LinkedState) ActionStartChRo()
- func (s *LinkedState) ActionSync()
- func (s *LinkedState) DistanceReceived(sender common.PeerAddr, distance int, direction int)
- func (s *LinkedState) GotValue(sender common.PeerAddr, value int)
- func (s *LinkedState) Init()
- func (s *LinkedState) LeaderChanged(sender common.PeerAddr, leader common.PeerAddr, value int)
- func (s *LinkedState) Name() string
- func (s *LinkedState) PeerRemoved(sender common.PeerAddr, removedPeer common.PeerAddr, direction int)
- func (s *LinkedState) RequestDistancesIfMissing()
- func (s *LinkedState) ValueSetConfirmed(sender common.PeerAddr)
- type NullState
- func (s *NullState) ActionDisconnect()
- func (s *NullState) ActionGetValue()
- func (s *NullState) ActionLeave() bool
- func (s *NullState) ActionReconnect()
- func (s *NullState) ActionReportPeer(addr common.PeerAddr)
- func (s *NullState) ActionSetValue(value int)
- func (s *NullState) ActionStartChRo()
- func (s *NullState) ActionSync()
- func (s *NullState) ChRoIdReceived(sender common.PeerAddr, id int)
- func (s *NullState) DistanceReceived(sender common.PeerAddr, distance int, direction int)
- func (s *NullState) DistanceRequested(sender common.PeerAddr, source common.PeerAddr)
- func (s *NullState) GotValue(sender common.PeerAddr, value int)
- func (s *NullState) Init()
- func (s *NullState) LeaderChanged(sender common.PeerAddr, leader common.PeerAddr, value int)
- func (s *NullState) Name() string
- func (s *NullState) NewPeer(sender common.PeerAddr, addr common.PeerAddr, name string, shouldReply bool)
- func (s *NullState) PeerRemoved(sender common.PeerAddr, reportedPeer common.PeerAddr, direction int)
- func (s *NullState) PeerReported(reportedPeer common.PeerAddr)
- func (s *NullState) SyncPeers(sender common.PeerAddr, values []string)
- func (s *NullState) ValueGetRequested(sender common.PeerAddr, source common.PeerAddr)
- func (s *NullState) ValueSetConfirmed(sender common.PeerAddr)
- func (s *NullState) ValueSetRequested(sender common.PeerAddr, source common.PeerAddr, value int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NotHandled ¶
func NotHandled()
Types ¶
type DiscoveryState ¶
type DiscoveryState struct {
NullState
Ctx *common.Context
// contains filtered or unexported fields
}
func (*DiscoveryState) ActionLeave ¶
func (s *DiscoveryState) ActionLeave() bool
func (*DiscoveryState) ActionStartChRo ¶
func (h *DiscoveryState) ActionStartChRo()
func (*DiscoveryState) ActionSync ¶
func (h *DiscoveryState) ActionSync()
func (*DiscoveryState) ChRoIdReceived ¶
func (h *DiscoveryState) ChRoIdReceived(sender common.PeerAddr, id int)
func (*DiscoveryState) Init ¶
func (s *DiscoveryState) Init()
func (*DiscoveryState) LeaderChanged ¶
func (*DiscoveryState) Name ¶
func (h *DiscoveryState) Name() string
func (*DiscoveryState) PeerRemoved ¶
func (*DiscoveryState) Ping ¶
func (h *DiscoveryState) Ping(sender common.PeerAddr, source common.PeerAddr)
type LeaderState ¶
type LeaderState struct {
DiscoveryState
Value int
}
func (*LeaderState) ActionGetValue ¶
func (s *LeaderState) ActionGetValue()
func (*LeaderState) ActionLeave ¶
func (s *LeaderState) ActionLeave() bool
func (*LeaderState) ActionReportPeer ¶
func (s *LeaderState) ActionReportPeer(addr common.PeerAddr)
func (*LeaderState) ActionSetValue ¶
func (s *LeaderState) ActionSetValue(value int)
func (*LeaderState) ActionStartChRo ¶
func (s *LeaderState) ActionStartChRo()
func (*LeaderState) ActionSync ¶
func (s *LeaderState) ActionSync()
func (*LeaderState) DistanceReceived ¶
func (s *LeaderState) DistanceReceived(sender common.PeerAddr, distance int, direction int)
func (*LeaderState) DistanceRequested ¶
func (s *LeaderState) DistanceRequested(sender common.PeerAddr, source common.PeerAddr)
func (*LeaderState) EmitDistanceBroadcast ¶
func (s *LeaderState) EmitDistanceBroadcast()
func (*LeaderState) Init ¶
func (s *LeaderState) Init()
func (*LeaderState) LeaderChanged ¶
func (*LeaderState) Name ¶
func (s *LeaderState) Name() string
func (*LeaderState) PeerRemoved ¶
func (*LeaderState) PeerReported ¶
func (s *LeaderState) PeerReported(reportedPeer common.PeerAddr)
func (*LeaderState) ValueGetRequested ¶
func (s *LeaderState) ValueGetRequested(sender common.PeerAddr, source common.PeerAddr)
func (*LeaderState) ValueSetRequested ¶
type LinkedState ¶
type LinkedState struct {
DiscoveryState
}
func (*LinkedState) ActionGetValue ¶
func (s *LinkedState) ActionGetValue()
func (*LinkedState) ActionLeave ¶
func (s *LinkedState) ActionLeave() bool
func (*LinkedState) ActionReportPeer ¶
func (s *LinkedState) ActionReportPeer(addr common.PeerAddr)
func (*LinkedState) ActionSetValue ¶
func (s *LinkedState) ActionSetValue(value int)
func (*LinkedState) ActionStartChRo ¶
func (s *LinkedState) ActionStartChRo()
func (*LinkedState) ActionSync ¶
func (s *LinkedState) ActionSync()
func (*LinkedState) DistanceReceived ¶
func (s *LinkedState) DistanceReceived(sender common.PeerAddr, distance int, direction int)
func (*LinkedState) Init ¶
func (s *LinkedState) Init()
func (*LinkedState) LeaderChanged ¶
func (*LinkedState) Name ¶
func (s *LinkedState) Name() string
func (*LinkedState) PeerRemoved ¶
func (*LinkedState) RequestDistancesIfMissing ¶
func (s *LinkedState) RequestDistancesIfMissing()
func (*LinkedState) ValueSetConfirmed ¶
func (s *LinkedState) ValueSetConfirmed(sender common.PeerAddr)
type NullState ¶
type NullState struct{}
func (*NullState) ActionDisconnect ¶
func (s *NullState) ActionDisconnect()
func (*NullState) ActionGetValue ¶
func (s *NullState) ActionGetValue()
func (*NullState) ActionLeave ¶
func (*NullState) ActionReconnect ¶
func (s *NullState) ActionReconnect()
func (*NullState) ActionReportPeer ¶
func (*NullState) ActionSetValue ¶
func (*NullState) ActionStartChRo ¶
func (s *NullState) ActionStartChRo()
func (*NullState) ActionSync ¶
func (s *NullState) ActionSync()
func (*NullState) ChRoIdReceived ¶
func (*NullState) DistanceReceived ¶
func (*NullState) DistanceRequested ¶
func (*NullState) LeaderChanged ¶
func (*NullState) PeerRemoved ¶
func (*NullState) PeerReported ¶
func (*NullState) ValueGetRequested ¶
func (*NullState) ValueSetConfirmed ¶
Click to show internal directories.
Click to hide internal directories.