receptionID

package
v5.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: BSD-2-Clause, BSD-2-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InvalidRequestedNumIdentities = errors.New("cannot get less than one identity(s)")

Functions

This section is empty.

Types

type EphemeralIdentity

type EphemeralIdentity struct {
	// Identity
	EphId  ephemeral.Id
	Source *id.ID
}

func BuildIdentityFromRound

func BuildIdentityFromRound(source *id.ID,
	round rounds.Round) EphemeralIdentity

BuildIdentityFromRound returns an EphemeralIdentity that the source would use to receive messages from the given round

type Identity

type Identity struct {
	// Identity
	EphemeralIdentity
	AddressSize uint8

	// Usage variables
	End         time.Time // Timestamp when active polling will stop
	ExtraChecks uint      // Number of extra checks executed as active after the

	// Polling parameters
	StartValid time.Time // Timestamp when the ephID begins being valid
	EndValid   time.Time // Timestamp when the ephID stops being valid

	// Makes the identity not store on disk
	Ephemeral bool

	// When this identity expired, it will auto add processNext to the identity list
	// to be processed. In practice this is a reverse ordered list and is added whenever
	// many identities are added at once in order to pick up sequentially
	ProcessNext *Identity
}

func (Identity) Equal

func (i Identity) Equal(b Identity) bool

func (Identity) GoString

func (i Identity) GoString() string

GoString returns a string representations of all the values in the Identity. This function adheres to the fmt.GoStringer interface.

func (Identity) String

func (i Identity) String() string

String returns a string representations of the ephemeral ID and source ID of the Identity. This function adheres to the fmt.Stringer interface.

type IdentityUse

type IdentityUse struct {
	Identity

	// Denotes if the identity is fake, in which case we do not process messages
	Fake bool

	UR *store.UnknownRounds
	ER *store.EarliestRound
	CR *store.CheckedRounds
}

func (IdentityUse) GoString

func (iu IdentityUse) GoString() string

GoString returns a string representations of all the values in the IdentityUse. This function adheres to the fmt.GoStringer interface.

type Store

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

func NewOrLoadStore

func NewOrLoadStore(kv *versioned.KV) *Store

NewOrLoadStore creates a new reception store that starts empty.

func (*Store) AddIdentity

func (s *Store) AddIdentity(identity Identity) error

func (*Store) ForEach

func (s *Store) ForEach(n int, rng io.Reader,
	addressSize uint8, operate func([]IdentityUse) error) error

ForEach operates on 'n' identities randomly in a random order. if no identities exist, it will operate on a single fake identity

func (*Store) RemoveIdentities

func (s *Store) RemoveIdentities(source *id.ID)

func (*Store) RemoveIdentity

func (s *Store) RemoveIdentity(ephID ephemeral.Id)

func (*Store) SetToExpire

func (s *Store) SetToExpire(addressSize uint8)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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