store

package
v4.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: BSD-2-Clause, BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Identity

type Identity struct {
	EpdId  ephemeral.Id
	Source *id.ID
}

Identity contains round identity information used in message retrieval. Derived from reception.Identity saving data needed for message retrieval.

type UncheckedRound

type UncheckedRound struct {
	Info *pb.RoundInfo
	Id   id.Round

	Identity
	// Timestamp in which round has last been checked
	LastCheck time.Time
	// Number of times a round has been checked
	NumChecks uint64
	// contains filtered or unexported fields
}

UncheckedRound contains rounds that failed on message retrieval. These rounds are stored for retry of message retrieval.

type UncheckedRoundStore

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

UncheckedRoundStore stores rounds to retry for message retrieval.

func LoadUncheckedStore

func LoadUncheckedStore(kv versioned.KV) (*UncheckedRoundStore, error)

LoadUncheckedStore loads a deserializes a UncheckedRoundStore from memory.

func NewOrLoadUncheckedStore

func NewOrLoadUncheckedStore(kv versioned.KV) *UncheckedRoundStore

NewOrLoadUncheckedStore is a constructor for a UncheckedRoundStore.

func NewUncheckedStore

func NewUncheckedStore(kv versioned.KV) (*UncheckedRoundStore, error)

NewUncheckedStore is a constructor for a UncheckedRoundStore.

func (*UncheckedRoundStore) AddRound

func (s *UncheckedRoundStore) AddRound(rid id.Round, ri *pb.RoundInfo,
	source *id.ID, ephID ephemeral.Id) error

AddRound adds a round to check on the list and saves to memory.

func (*UncheckedRoundStore) EndCheck

func (s *UncheckedRoundStore) EndCheck(rid id.Round, recipient *id.ID,
	ephId ephemeral.Id) error

EndCheck increments the amount of checks performed on this stored round.

func (*UncheckedRoundStore) GetList

func (s *UncheckedRoundStore) GetList(_ *testing.T) map[roundIdentity]UncheckedRound

func (*UncheckedRoundStore) GetRound

func (s *UncheckedRoundStore) GetRound(rid id.Round, recipient *id.ID,
	ephId ephemeral.Id) (UncheckedRound, bool)

GetRound retrieves an UncheckedRound from the map, if it exists.

func (*UncheckedRoundStore) IncrementCheck

func (s *UncheckedRoundStore) IncrementCheck(rid id.Round, recipient *id.ID,
	ephId ephemeral.Id) error

IncrementCheck increments the amount of checks performed on this stored round.

func (*UncheckedRoundStore) IterateOverList

func (s *UncheckedRoundStore) IterateOverList(iterator func(rid id.Round,
	rnd UncheckedRound))

IterateOverList retrieves the list of rounds.

func (*UncheckedRoundStore) Remove

func (s *UncheckedRoundStore) Remove(rid id.Round, source *id.ID,
	ephId ephemeral.Id) error

Remove deletes a round from UncheckedRoundStore's list and from storage.

Jump to

Keyboard shortcuts

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