datasync

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2019 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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
	// DataSyncNodeTransport is the implementation of the datasync transport interface.
	*DataSyncNodeTransport
	// contains filtered or unexported fields
}

func New

func New(node *datasyncnode.Node, transport *DataSyncNodeTransport, 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 DataSyncNodeTransport

type DataSyncNodeTransport struct {
	// contains filtered or unexported fields
}

func NewDataSyncNodeTransport

func NewDataSyncNodeTransport() *DataSyncNodeTransport

func (*DataSyncNodeTransport) AddPacket

func (t *DataSyncNodeTransport) AddPacket(p transport.Packet)

func (*DataSyncNodeTransport) Init

func (*DataSyncNodeTransport) Send

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

func (*DataSyncNodeTransport) Watch

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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