datasync

package
v0.94.10 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: MPL-2.0, MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DatasyncTicker = 300 * time.Millisecond

Functions

func CalculateSendTime

func CalculateSendTime(count uint64, time int64) int64

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

func ToGroupID

func ToGroupID(data []byte) state.GroupID

func ToOneToOneGroupID

func ToOneToOneGroupID(key1 *ecdsa.PublicKey, key2 *ecdsa.PublicKey) state.GroupID

ToOneToOneGroupID returns a groupID for a onetoonechat, which is taken by concatenating the bytes of the compressed keys, in ascending order by X

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

func (*DataSync) Stop

func (d *DataSync) Stop()

func (*DataSync) UnwrapPayloadsAndAcks added in v0.71.5

func (d *DataSync) UnwrapPayloadsAndAcks(sender *ecdsa.PublicKey, payload []byte) ([][]byte, [][]byte, error)

UnwrapPayloadsAndAcks tries to unwrap datasync message and return messages payloads and acknowledgements for previously sent messages

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

func (t *NodeTransport) Init(dispatch func(context.Context, *ecdsa.PublicKey, []byte, *protobuf.Payload) error, maxMessageSize uint32, logger *zap.Logger)

func (*NodeTransport) Send

func (t *NodeTransport) Send(_ state.PeerID, peer state.PeerID, payload protobuf.Payload) error

func (*NodeTransport) Watch

func (t *NodeTransport) Watch() transport.Packet

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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