datasync

package
v0.174.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MPL-2.0, MPL-2.0 Imports: 13 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) Unwrap added in v0.171.35

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

Unwrap tries to unwrap datasync message and passes back the message to datasync in order to acknowledge any potential message and mark messages as acknowledged

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(state.PeerID, *protobuf.Payload) error, 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