consumerstorage

package
v0.0.0-...-79ba347 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumersStorage

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

ConsumersStorage represents in-memory storage of intermediate trusts of the peer consumers.

Maps daughter peers to repositories of the trusts of their consumers.

func (*ConsumersStorage) Iterate

Iterate passes IDs of the daughter peers with the trusts of their consumers to h.

Returns errors from h directly.

type ConsumersTrusts

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

ConsumersTrusts represents in-memory storage of the trusts of the consumer peers to some other peer.

func (*ConsumersTrusts) Iterate

func (x *ConsumersTrusts) Iterate(h reputation.TrustHandler) (err error)

Iterate passes all stored trusts to h.

Returns errors from h directly.

type Prm

type Prm struct{}

Prm groups the required parameters of the Storage's constructor.

All values must comply with the requirements imposed on them. Passing incorrect parameter values will result in constructor failure (error or panic depending on the implementation).

The component is not parameterizable at the moment.

type Storage

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

Storage represents in-memory storage of the trusts of the consumer peers.

It maps epoch numbers to the repositories of intermediate trusts of the consumers of the daughter peers.

For correct operation, Storage must be created using the constructor (New) based on the required parameters and optional components. After successful creation, Storage is immediately ready to work through API.

func New

func New(_ Prm) *Storage

New creates a new instance of the Storage.

The created Storage does not require additional initialization and is completely ready for work.

func (*Storage) Consumers

func (x *Storage) Consumers(epoch uint64, iter uint32) (*ConsumersStorage, bool)

Consumers returns the storage of trusts of the consumers of the daughter peers for particular iteration of EigenTrust calculation for particular epoch.

Returns false if there is no data for the epoch and iter.

func (*Storage) Put

func (x *Storage) Put(trust eigentrust.IterationTrust)

Put saves intermediate trust of the consumer to daughter peer.

Jump to

Keyboard shortcuts

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