genSync

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: GPL-3.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	SYNC_SUCCESS  uint8 = 0
	SYNC_FAIL     uint8 = 1
	SYNC_SKIP     uint8 = 2
	SYNC_CONTINUE uint8 = 3
	SYNC_RETRY    uint8 = 4
)

Variables

This section is empty.

Functions

func ToBigInt

func ToBigInt(input interface{}) *bigint

Types

type Connection

type Connection interface {
	Listen() error
	Connect() error
	Send(data []byte) (int, error)
	Receive() ([]byte, error)
	SendBytesSlice(dataSlice [][]byte) (int, error)
	ReceiveBytesSlice() ([][]byte, error)
	SendSkipSyncBoolWithInfo(skipSync bool, format string, args ...interface{}) error
	ReceiveSkipSyncBoolWithInfo(format string, args ...interface{}) (bool, error)
	SendSyncStatus(syncStatus uint8) error
	ReceiveSyncStatus() (uint8, error)
	Close() error
	GetIp() string
	GetPort() string
	GetSentBytes() int
	GetReceivedBytes() int
	GetTotalBytes() int
}

func NewTcpConnection

func NewTcpConnection(ipAddr string, port int) (Connection, error)

type GenSync

type GenSync interface {
	SetFreezeLocal(freezeLocal bool)

	AddElement(elem interface{}) error
	DeleteElement(elem interface{}) error

	SyncClient(ip string, port int) error
	SyncServer(ip string, port int) error

	GetLocalSet() *set.Set
	GetSetAdditions() *set.Set // Set the set that is added to the local set.
	GetSentBytes() int
	GetReceivedBytes() int
	GetTotalBytes() int
}

Jump to

Keyboard shortcuts

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