internal

package
v0.27.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package internal provides functionality for NeoFS Node Reputation system communication with NeoFS network. The base client for accessing remote nodes via NeoFS API is a NeoFS SDK Go API client. However, although it encapsulates a useful piece of business logic (e.g. the signature mechanism), the Reputation service does not fully use the client's flexible interface.

In this regard, this package provides functions over base API client necessary for the application. This allows you to concentrate the entire spectrum of the client's use in one place (this will be convenient both when updating the base client and for evaluating the UX of SDK library). So it is expected that all Reputation service packages will be limited to this package for the development of functionality requiring NeoFS API communication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnnounceIntermediatePrm

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

AnnounceIntermediatePrm groups parameters of AnnounceIntermediate operation.

func (*AnnounceIntermediatePrm) SetClient

func (x *AnnounceIntermediatePrm) SetClient(cli client.Client)

SetClient sets base client for NeoFS API communication.

Required parameter.

func (*AnnounceIntermediatePrm) SetContext

func (x *AnnounceIntermediatePrm) SetContext(ctx context.Context)

SetContext sets context.Context for network communication.

Required parameter.

func (*AnnounceIntermediatePrm) SetEpoch

func (x *AnnounceIntermediatePrm) SetEpoch(epoch uint64)

SetEpoch sets number of the epoch when the trust calculation's iteration was executed.

func (*AnnounceIntermediatePrm) SetIteration

func (x *AnnounceIntermediatePrm) SetIteration(iter uint32)

SetIteration sets number of the iteration of the trust calculation algorithm.

func (*AnnounceIntermediatePrm) SetPrivateKey

func (x *AnnounceIntermediatePrm) SetPrivateKey(key *ecdsa.PrivateKey)

SetPrivateKey sets private key to sign the request(s).

Required parameter.

func (*AnnounceIntermediatePrm) SetTrust

SetTrust sets current global trust value computed at the iteration.

type AnnounceIntermediateRes

type AnnounceIntermediateRes struct{}

AnnounceIntermediateRes groups resulting values of AnnounceIntermediate operation.

func AnnounceIntermediate

func AnnounceIntermediate(prm AnnounceIntermediatePrm) (res AnnounceIntermediateRes, err error)

AnnounceIntermediate sends global trust value calculated at the specified iteration and epoch to to the remote node.

Client, context and key must be set.

Returns any error prevented the operation from completing correctly in error return.

type AnnounceLocalPrm

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

AnnounceLocalPrm groups parameters of AnnounceLocal operation.

func (*AnnounceLocalPrm) SetClient

func (x *AnnounceLocalPrm) SetClient(cli client.Client)

SetClient sets base client for NeoFS API communication.

Required parameter.

func (*AnnounceLocalPrm) SetContext

func (x *AnnounceLocalPrm) SetContext(ctx context.Context)

SetContext sets context.Context for network communication.

Required parameter.

func (*AnnounceLocalPrm) SetEpoch

func (x *AnnounceLocalPrm) SetEpoch(epoch uint64)

SetEpoch sets epoch in which the trust was assessed.

func (*AnnounceLocalPrm) SetPrivateKey

func (x *AnnounceLocalPrm) SetPrivateKey(key *ecdsa.PrivateKey)

SetPrivateKey sets private key to sign the request(s).

Required parameter.

func (*AnnounceLocalPrm) SetTrusts

func (x *AnnounceLocalPrm) SetTrusts(ts []*reputation.Trust)

SetTrusts sets list of local trust values.

type AnnounceLocalRes

type AnnounceLocalRes struct{}

AnnounceLocalRes groups resulting values of AnnounceLocal operation.

func AnnounceLocal

func AnnounceLocal(prm AnnounceLocalPrm) (res AnnounceLocalRes, err error)

AnnounceLocal sends estimations of local trust to the remote node.

Client, context and key must be set.

Returns any error prevented the operation from completing correctly in error return.

Jump to

Keyboard shortcuts

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