state

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2019 License: MIT Imports: 1 Imported by: 4

Documentation

Overview

Package state contains everything related to the synchronization state for MVDS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSyncState

func NewSyncState() *memorySyncState

Types

type GroupID

type GroupID [32]byte

type MessageID

type MessageID [32]byte

type PeerID

type PeerID [65]byte

type RecordType added in v0.0.16

type RecordType int
const (
	OFFER RecordType = iota
	REQUEST
	MESSAGE
)

type State

type State struct {
	Type      RecordType
	SendCount uint64
	SendEpoch int64
}

type SyncState

type SyncState interface {
	Get(group GroupID, id MessageID, peer PeerID) (State, error)
	Set(group GroupID, id MessageID, peer PeerID, newState State) error
	Remove(group GroupID, id MessageID, peer PeerID) error
	Map(epoch int64, process func(GroupID, MessageID, PeerID, State) State) error
}

Jump to

Keyboard shortcuts

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