netsync

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultIP         = "tcp://0.0.0.0:4435"
	DefaultTLSIP      = "tcp://0.0.0.0:4455"
	RequestTypeUpdate = 1
	RequestTypeSync   = 2
)

Variables

This section is empty.

Functions

func Decode

func Decode(byts []byte) (interface{}, error)

func Encode

func Encode(elem interface{}) ([]byte, error)

Types

type NetSync

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

func NewWithGlobalServers

func NewWithGlobalServers(localAddress string, store *datastore.DataStore) NetSync

func (NetSync) RequestSync

func (ns NetSync) RequestSync(begin int) error

func (NetSync) RunServer

func (ns NetSync) RunServer(tlsConfig *tls.Config)

func (NetSync) SendUpdate

func (ns NetSync) SendUpdate(update Update) error

func (NetSync) UpdateGlobalServerPool

func (ns NetSync) UpdateGlobalServerPool()

type Network

type Network struct {
	Local string
	Pool  []string
}

type Request

type Request struct {
	Type   int
	Update *Update
	Sync   *Sync
}

type Sync

type Sync struct {
	BeginAt int
}

type Update

type Update struct {
	ToDelete bool
	User     datastore.User
}

Jump to

Keyboard shortcuts

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