daughters

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DaughterStorage

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

DaughterStorage maps IDs of daughter peers to repositories of the local trusts to their providers.

func (*DaughterStorage) Iterate

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

Returns errors from h directly.

type DaughterTrusts

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

DaughterTrusts represents in-memory storage of local trusts of the daughter peer to its providers.

Maps IDs of daughter's providers to the local trusts to them.

func (*DaughterTrusts) Iterate

func (x *DaughterTrusts) 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 local trust values of the daughter peers.

It maps epoch numbers to the repositories of local trusts 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) AllDaughterTrusts

func (x *Storage) AllDaughterTrusts(epoch uint64) (*DaughterStorage, bool)

AllDaughterTrusts returns daughter iterator for the epoch.

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

func (*Storage) DaughterTrusts

func (x *Storage) DaughterTrusts(epoch uint64, daughter apireputation.PeerID) (*DaughterTrusts, bool)

DaughterTrusts returns daughter trusts for the epoch.

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

func (*Storage) Put

func (x *Storage) Put(epoch uint64, trust reputation.Trust)

Put saves daughter peer's trust to its provider for the epoch.

Jump to

Keyboard shortcuts

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