datasync

package
v0.71.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 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.

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

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

func (*DataSync) Stop

func (d *DataSync) Stop()

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