Documentation ¶
Index ¶
- Variables
- func CalculateSendTime(count uint64, time int64) int64
- func ToGroupID(data []byte) state.GroupID
- func ToOneToOneGroupID(key1 *ecdsa.PublicKey, key2 *ecdsa.PublicKey) state.GroupID
- type DataSync
- type NodeTransport
- func (t *NodeTransport) AddPacket(p transport.Packet)
- func (t *NodeTransport) Init(dispatch func(state.PeerID, *protobuf.Payload) error, logger *zap.Logger)
- func (t *NodeTransport) Send(_ state.PeerID, peer state.PeerID, payload *protobuf.Payload) error
- func (t *NodeTransport) Watch() transport.Packet
Constants ¶
This section is empty.
Variables ¶
View Source
var DatasyncTicker = 300 * time.Millisecond
Functions ¶
func CalculateSendTime ¶
CalculateSendTime calculates the next epoch at which a message should be sent. We randomize it a bit so that not all messages are sent on the same epoch
Types ¶
type DataSync ¶
type DataSync struct { *datasyncnode.Node // NodeTransport is the implementation of the datasync transport interface. *NodeTransport // contains filtered or unexported fields }
func New ¶
func New(node *datasyncnode.Node, transport *NodeTransport, sendingEnabled bool, logger *zap.Logger) *DataSync
type NodeTransport ¶
type NodeTransport struct {
// contains filtered or unexported fields
}
func NewNodeTransport ¶
func NewNodeTransport() *NodeTransport
func (*NodeTransport) AddPacket ¶
func (t *NodeTransport) AddPacket(p transport.Packet)
func (*NodeTransport) Watch ¶
func (t *NodeTransport) Watch() transport.Packet
Click to show internal directories.
Click to hide internal directories.