state

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: MIT Imports: 4 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

func ID

ID creates the MessageID for a Message

type MessageType added in v0.0.15

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

type PeerID

type PeerID [65]byte

type State

type State struct {
	Type      MessageType
	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