state

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2019 License: MIT Imports: 6 Imported by: 4

Documentation

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 PeerID

type PeerID [64]byte

func PublicKeyToPeerID

func PublicKeyToPeerID(k ecdsa.PublicKey) PeerID

Turns an ECSDA PublicKey to a PeerID

type State

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