state

package
v0.0.26 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 4 Imported by: 2 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrStateNotFound = errors.New("state not found")
)

Functions

func NewPersistentSyncState added in v0.0.26

func NewPersistentSyncState(db *sql.DB) *sqliteSyncState

func NewSyncState

func NewSyncState() *memorySyncState

Types

type GroupID

type GroupID [32]byte

type MessageID

type MessageID [32]byte

type PeerID

type PeerID [65]byte

PeerID is the ID for a specific peer.

type RecordType added in v0.0.16

type RecordType int

RecordType is the type for a specific record, either `OFFER`, `REQUEST` or `MESSAGE`.

const (
	OFFER RecordType = iota
	REQUEST
	MESSAGE
)

type State

type State struct {
	Type      RecordType
	SendCount uint64
	SendEpoch int64
	// GroupID is optional, thus nullable
	GroupID   *GroupID
	PeerID    PeerID
	MessageID MessageID
}

State is a struct used to store a records state(https://github.com/status-im/bigbrother-specs/blob/master/data_sync/mvds.md#state).

type SyncState

type SyncState interface {
	Add(newState State) error
	Remove(id MessageID, peer PeerID) error
	All(epoch int64) ([]State, error)
	Map(epoch int64, process func(State) State) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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