reputation

package
v2.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: Apache-2.0 Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TrustsToGRPC

func TrustsToGRPC(xs []Trust) (res []*reputation.Trust)

TrustsToGRPC converts slice of Trust structures to slice of gRPC-generated Trust messages.

Types

type AnnounceIntermediateResultRequest

type AnnounceIntermediateResultRequest struct {
	session.RequestHeaders
	// contains filtered or unexported fields
}

AnnounceIntermediateResultRequest represents reputation.AnnounceIntermediateResult message from NeoFS API v2.

func (*AnnounceIntermediateResultRequest) FromGRPCMessage

func (x *AnnounceIntermediateResultRequest) FromGRPCMessage(m grpc.Message) error

FromGRPCMessage tries to restore AnnounceIntermediateResultRequest from grpc.Message.

Returns message.ErrUnexpectedMessageType if m is not a gRPC-generated reputation.AnnounceIntermediateResultRequest message.

func (*AnnounceIntermediateResultRequest) GetBody

GetBody returns request body.

func (*AnnounceIntermediateResultRequest) SetBody

SetBody sets request body.

func (*AnnounceIntermediateResultRequest) ToGRPCMessage

func (x *AnnounceIntermediateResultRequest) ToGRPCMessage() grpc.Message

ToGRPCMessage converts AnnounceIntermediateResultRequest to gRPC-generated reputation.AnnounceIntermediateResultRequest message.

type AnnounceIntermediateResultRequestBody

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

AnnounceIntermediateResultRequestBody is a structure of AnnounceIntermediateResult request body.

func (*AnnounceIntermediateResultRequestBody) FromGRPCMessage

FromGRPCMessage tries to restore AnnounceIntermediateResultRequestBody from grpc.Message.

Returns message.ErrUnexpectedMessageType if m is not a gRPC-generated reputation.AnnounceIntermediateResultRequest_Body message.

func (*AnnounceIntermediateResultRequestBody) GetEpoch

GetEpoch returns epoch number in which the intermediate trust was assessed.

func (*AnnounceIntermediateResultRequestBody) GetIteration

GetIteration returns sequence number of the iteration.

func (*AnnounceIntermediateResultRequestBody) GetTrust

GetTrust returns current global trust value.

func (*AnnounceIntermediateResultRequestBody) SetEpoch

SetEpoch sets epoch number in which the intermediate trust was assessed.

func (*AnnounceIntermediateResultRequestBody) SetIteration

func (x *AnnounceIntermediateResultRequestBody) SetIteration(v uint32)

SetIteration sets sequence number of the iteration.

func (*AnnounceIntermediateResultRequestBody) SetTrust

SetTrust sets current global trust value.

func (*AnnounceIntermediateResultRequestBody) StableMarshal

func (x *AnnounceIntermediateResultRequestBody) StableMarshal(buf []byte) []byte

func (*AnnounceIntermediateResultRequestBody) StableSize

func (x *AnnounceIntermediateResultRequestBody) StableSize() (size int)

func (*AnnounceIntermediateResultRequestBody) ToGRPCMessage

ToGRPCMessage converts AnnounceIntermediateResultRequestBody to gRPC-generated reputation.AnnounceIntermediateResultRequest_Body message.

func (*AnnounceIntermediateResultRequestBody) Unmarshal

func (x *AnnounceIntermediateResultRequestBody) Unmarshal(data []byte) error

type AnnounceIntermediateResultResponse

type AnnounceIntermediateResultResponse struct {
	session.ResponseHeaders
	// contains filtered or unexported fields
}

AnnounceIntermediateResultResponse represents reputation.AnnounceIntermediateResultResponse message from NeoFS API v2.

func (*AnnounceIntermediateResultResponse) FromGRPCMessage

func (x *AnnounceIntermediateResultResponse) FromGRPCMessage(m grpc.Message) error

FromGRPCMessage tries to restore AnnounceIntermediateResultResponse from grpc.Message.

Returns message.ErrUnexpectedMessageType if m is not a gRPC-generated reputation.AnnounceIntermediateResultResponse message.

func (*AnnounceIntermediateResultResponse) GetBody

GetBody returns response body.

func (*AnnounceIntermediateResultResponse) SetBody

SetBody sets response body.

func (*AnnounceIntermediateResultResponse) ToGRPCMessage

func (x *AnnounceIntermediateResultResponse) ToGRPCMessage() grpc.Message

ToGRPCMessage converts AnnounceIntermediateResultResponse to gRPC-generated reputation.AnnounceIntermediateResultResponse message.

type AnnounceIntermediateResultResponseBody

type AnnounceIntermediateResultResponseBody struct{}

AnnounceIntermediateResultResponseBody is a structure of AnnounceIntermediateResult response body.

func (*AnnounceIntermediateResultResponseBody) FromGRPCMessage

FromGRPCMessage tries to restore AnnounceIntermediateResultResponseBody from grpc.Message.

Returns message.ErrUnexpectedMessageType if m is not a gRPC-generated reputation.AnnounceIntermediateResultResponse_Body message.

func (*AnnounceIntermediateResultResponseBody) StableMarshal

func (x *AnnounceIntermediateResultResponseBody) StableMarshal(buf []byte) []byte

func (*AnnounceIntermediateResultResponseBody) StableSize

func (*AnnounceIntermediateResultResponseBody) ToGRPCMessage

ToGRPCMessage converts AnnounceIntermediateResultResponseBody to gRPC-generated reputation.AnnounceIntermediateResultResponse_Body message.

func (*AnnounceIntermediateResultResponseBody) Unmarshal

func (x *AnnounceIntermediateResultResponseBody) Unmarshal(data []byte) error

type AnnounceLocalTrustRequest

type AnnounceLocalTrustRequest struct {
	session.RequestHeaders
	// contains filtered or unexported fields
}

AnnounceLocalTrustRequest represents reputation.AnnounceLocalTrustRequest message from NeoFS API v2.

func (*AnnounceLocalTrustRequest) FromGRPCMessage

func (x *AnnounceLocalTrustRequest) FromGRPCMessage(m grpc.Message) error

FromGRPCMessage tries to restore AnnounceLocalTrustRequest from grpc.Message.

Returns message.ErrUnexpectedMessageType if m is not a gRPC-generated reputation.AnnounceLocalTrustRequest message.

func (*AnnounceLocalTrustRequest) GetBody

GetBody returns request body.

func (*AnnounceLocalTrustRequest) SetBody

SetBody sets request body.

func (*AnnounceLocalTrustRequest) ToGRPCMessage

func (x *AnnounceLocalTrustRequest) ToGRPCMessage() grpc.Message

ToGRPCMessage converts AnnounceLocalTrustRequest to gRPC-generated reputation.AnnounceLocalTrustRequest message.

type AnnounceLocalTrustRequestBody

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

AnnounceLocalTrustRequestBody is a structure of AnnounceLocalTrust request body.

func (*AnnounceLocalTrustRequestBody) FromGRPCMessage

func (x *AnnounceLocalTrustRequestBody) FromGRPCMessage(m grpc.Message) error

FromGRPCMessage tries to restore AnnounceLocalTrustRequestBody from grpc.Message.

Returns message.ErrUnexpectedMessageType if m is not a gRPC-generated reputation.AnnounceLocalTrustRequest_Body message.

func (*AnnounceLocalTrustRequestBody) GetEpoch

func (x *AnnounceLocalTrustRequestBody) GetEpoch() uint64

GetEpoch returns epoch in which the trust was assessed.

func (*AnnounceLocalTrustRequestBody) GetTrusts

func (x *AnnounceLocalTrustRequestBody) GetTrusts() []Trust

GetTrusts returns list of normalized trust values.

func (*AnnounceLocalTrustRequestBody) SetEpoch

func (x *AnnounceLocalTrustRequestBody) SetEpoch(v uint64)

SetEpoch sets epoch in which the trust was assessed.

func (*AnnounceLocalTrustRequestBody) SetTrusts

func (x *AnnounceLocalTrustRequestBody) SetTrusts(v []Trust)

SetTrusts sets list of normalized trust values.

func (*AnnounceLocalTrustRequestBody) StableMarshal

func (x *AnnounceLocalTrustRequestBody) StableMarshal(buf []byte) []byte

func (*AnnounceLocalTrustRequestBody) StableSize

func (x *AnnounceLocalTrustRequestBody) StableSize() (size int)

func (*AnnounceLocalTrustRequestBody) ToGRPCMessage

func (x *AnnounceLocalTrustRequestBody) ToGRPCMessage() grpc.Message

ToGRPCMessage converts AnnounceLocalTrustRequestBody to gRPC-generated reputation.AnnounceLocalTrustRequest_Body message.

func (*AnnounceLocalTrustRequestBody) Unmarshal

func (x *AnnounceLocalTrustRequestBody) Unmarshal(data []byte) error

type AnnounceLocalTrustResponse

type AnnounceLocalTrustResponse struct {
	session.ResponseHeaders
	// contains filtered or unexported fields
}

AnnounceLocalTrustResponse represents reputation.AnnounceLocalTrustResponse message from NeoFS API v2.

func (*AnnounceLocalTrustResponse) FromGRPCMessage

func (x *AnnounceLocalTrustResponse) FromGRPCMessage(m grpc.Message) error

FromGRPCMessage tries to restore AnnounceLocalTrustResponse from grpc.Message.

Returns message.ErrUnexpectedMessageType if m is not a gRPC-generated reputation.AnnounceLocalTrustResponse message.

func (*AnnounceLocalTrustResponse) GetBody

GetBody returns response body.

func (*AnnounceLocalTrustResponse) SetBody

SetBody sets response body.

func (*AnnounceLocalTrustResponse) ToGRPCMessage

func (x *AnnounceLocalTrustResponse) ToGRPCMessage() grpc.Message

ToGRPCMessage converts AnnounceLocalTrustResponse to gRPC-generated reputation.AnnounceLocalTrustResponse message.

type AnnounceLocalTrustResponseBody

type AnnounceLocalTrustResponseBody struct{}

AnnounceLocalTrustResponseBody is a structure of AnnounceLocalTrust response body.

func (*AnnounceLocalTrustResponseBody) FromGRPCMessage

func (x *AnnounceLocalTrustResponseBody) FromGRPCMessage(m grpc.Message) error

FromGRPCMessage tries to restore AnnounceLocalTrustResponseBody from grpc.Message.

Returns message.ErrUnexpectedMessageType if m is not a gRPC-generated reputation.AnnounceLocalTrustResponse_Body message.

func (*AnnounceLocalTrustResponseBody) StableMarshal

func (x *AnnounceLocalTrustResponseBody) StableMarshal(buf []byte) []byte

func (*AnnounceLocalTrustResponseBody) StableSize

func (x *AnnounceLocalTrustResponseBody) StableSize() int

func (*AnnounceLocalTrustResponseBody) ToGRPCMessage

func (x *AnnounceLocalTrustResponseBody) ToGRPCMessage() grpc.Message

ToGRPCMessage converts AnnounceLocalTrustResponseBody to gRPC-generated reputation.AnnounceLocalTrustResponse_Body message.

func (*AnnounceLocalTrustResponseBody) Unmarshal

func (x *AnnounceLocalTrustResponseBody) Unmarshal(data []byte) error

type GlobalTrust

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

GlobalTrust represents reputation.GlobalTrust message from NeoFS API v2.

func (*GlobalTrust) FromGRPCMessage

func (x *GlobalTrust) FromGRPCMessage(m grpc.Message) error

FromGRPCMessage tries to restore GlobalTrust from grpc.Message.

Returns message.ErrUnexpectedMessageType if m is not a gRPC-generated reputation.GlobalTrust message.

func (*GlobalTrust) GetBody

func (x *GlobalTrust) GetBody() *GlobalTrustBody

GetBody returns message body.

func (*GlobalTrust) GetSignature

func (x *GlobalTrust) GetSignature() *refs.Signature

GetSignature returns body signature.

func (*GlobalTrust) GetVersion

func (x *GlobalTrust) GetVersion() *refs.Version

GetVersion returns message format version.

func (*GlobalTrust) MarshalJSON

func (x *GlobalTrust) MarshalJSON() ([]byte, error)

func (*GlobalTrust) SetBody

func (x *GlobalTrust) SetBody(v *GlobalTrustBody)

SetBody sets message body.

func (*GlobalTrust) SetSignature

func (x *GlobalTrust) SetSignature(v *refs.Signature)

SetSignature sets body signature.

func (*GlobalTrust) SetVersion

func (x *GlobalTrust) SetVersion(v *refs.Version)

SetVersion sets message format version.

func (*GlobalTrust) StableMarshal

func (x *GlobalTrust) StableMarshal(buf []byte) []byte

func (*GlobalTrust) StableSize

func (x *GlobalTrust) StableSize() (size int)

func (*GlobalTrust) ToGRPCMessage

func (x *GlobalTrust) ToGRPCMessage() grpc.Message

ToGRPCMessage converts GlobalTrust to gRPC-generated reputation.GlobalTrust message.

func (*GlobalTrust) Unmarshal

func (x *GlobalTrust) Unmarshal(data []byte) error

func (*GlobalTrust) UnmarshalJSON

func (x *GlobalTrust) UnmarshalJSON(data []byte) error

type GlobalTrustBody

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

GlobalTrustBody represents reputation.GlobalTrust.Body message from NeoFS API v2.

func (*GlobalTrustBody) FromGRPCMessage

func (x *GlobalTrustBody) FromGRPCMessage(m grpc.Message) error

FromGRPCMessage tries to restore GlobalTrustBody from grpc.Message.

Returns message.ErrUnexpectedMessageType if m is not a gRPC-generated reputation.GlobalTrust_Body message.

func (*GlobalTrustBody) GetManager

func (x *GlobalTrustBody) GetManager() *PeerID

GetManager returns node manager ID.

func (*GlobalTrustBody) GetTrust

func (x *GlobalTrustBody) GetTrust() *Trust

GetTrust returns global trust value.

func (*GlobalTrustBody) SetManager

func (x *GlobalTrustBody) SetManager(v *PeerID)

SetManager sets node manager ID.

func (*GlobalTrustBody) SetTrust

func (x *GlobalTrustBody) SetTrust(v *Trust)

SetTrust sets global trust value.

func (*GlobalTrustBody) StableMarshal

func (x *GlobalTrustBody) StableMarshal(buf []byte) []byte

func (*GlobalTrustBody) StableSize

func (x *GlobalTrustBody) StableSize() (size int)

func (*GlobalTrustBody) ToGRPCMessage

func (x *GlobalTrustBody) ToGRPCMessage() grpc.Message

ToGRPCMessage converts GlobalTrustBody to gRPC-generated reputation.GlobalTrust_Body message.

func (*GlobalTrustBody) Unmarshal

func (x *GlobalTrustBody) Unmarshal(data []byte) error

type PeerID

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

PeerID represents reputation.PeerID message from NeoFS API v2.

func (*PeerID) FromGRPCMessage

func (x *PeerID) FromGRPCMessage(m grpc.Message) error

FromGRPCMessage tries to restore PeerID from grpc.Message.

Returns message.ErrUnexpectedMessageType if m is not a gRPC-generated reputation.PeerID message.

func (*PeerID) GetPublicKey

func (x *PeerID) GetPublicKey() []byte

GetPublicKey returns peer's binary public key of ID.

func (*PeerID) MarshalJSON

func (x *PeerID) MarshalJSON() ([]byte, error)

func (*PeerID) SetPublicKey

func (x *PeerID) SetPublicKey(v []byte)

SetPublicKey sets peer's binary public key of ID.

func (*PeerID) StableMarshal

func (x *PeerID) StableMarshal(buf []byte) []byte

func (*PeerID) StableSize

func (x *PeerID) StableSize() (size int)

func (*PeerID) ToGRPCMessage

func (x *PeerID) ToGRPCMessage() grpc.Message

ToGRPCMessage converts PeerID to gRPC-generated reputation.PeerID message.

func (*PeerID) Unmarshal

func (x *PeerID) Unmarshal(data []byte) error

func (*PeerID) UnmarshalJSON

func (x *PeerID) UnmarshalJSON(data []byte) error

type PeerToPeerTrust

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

PeerToPeerTrust represents reputation.PeerToPeerTrust message from NeoFS API v2.

func (*PeerToPeerTrust) FromGRPCMessage

func (x *PeerToPeerTrust) FromGRPCMessage(m grpc.Message) error

FromGRPCMessage tries to restore PeerToPeerTrust from grpc.Message.

Returns message.ErrUnexpectedMessageType if m is not a gRPC-generated reputation.PeerToPeerTrust message.

func (*PeerToPeerTrust) GetTrust

func (x *PeerToPeerTrust) GetTrust() *Trust

GetTrust returns trust value of trusting peer to the trusted one.

func (*PeerToPeerTrust) GetTrustingPeer

func (x *PeerToPeerTrust) GetTrustingPeer() *PeerID

GetTrustingPeer returns trusting peer ID.

func (*PeerToPeerTrust) MarshalJSON

func (x *PeerToPeerTrust) MarshalJSON() ([]byte, error)

func (*PeerToPeerTrust) SetTrust

func (x *PeerToPeerTrust) SetTrust(v *Trust)

SetTrust sets trust value of trusting peer to the trusted one.

func (*PeerToPeerTrust) SetTrustingPeer

func (x *PeerToPeerTrust) SetTrustingPeer(v *PeerID)

SetTrustingPeer sets trusting peer ID.

func (*PeerToPeerTrust) StableMarshal

func (x *PeerToPeerTrust) StableMarshal(buf []byte) []byte

func (*PeerToPeerTrust) StableSize

func (x *PeerToPeerTrust) StableSize() (size int)

func (*PeerToPeerTrust) ToGRPCMessage

func (x *PeerToPeerTrust) ToGRPCMessage() grpc.Message

ToGRPCMessage converts PeerToPeerTrust to gRPC-generated reputation.PeerToPeerTrust message.

func (*PeerToPeerTrust) Unmarshal

func (x *PeerToPeerTrust) Unmarshal(data []byte) error

func (*PeerToPeerTrust) UnmarshalJSON

func (x *PeerToPeerTrust) UnmarshalJSON(data []byte) error

type Trust

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

Trust represents reputation.Trust message from NeoFS API v2.

func TrustsFromGRPC

func TrustsFromGRPC(xs []*reputation.Trust) (res []Trust, err error)

TrustsFromGRPC tries to restore slice of Trust structures from slice of gRPC-generated reputation.Trust messages.

func (*Trust) FromGRPCMessage

func (x *Trust) FromGRPCMessage(m grpc.Message) error

FromGRPCMessage tries to restore Trust from grpc.Message.

Returns message.ErrUnexpectedMessageType if m is not a gRPC-generated reputation.Trust message.

func (*Trust) GetPeer

func (x *Trust) GetPeer() *PeerID

GetPeer returns trusted peer's ID.

func (*Trust) GetValue

func (x *Trust) GetValue() float64

GetValue returns trust value.

func (*Trust) MarshalJSON

func (x *Trust) MarshalJSON() ([]byte, error)

func (*Trust) SetPeer

func (x *Trust) SetPeer(v *PeerID)

SetPeer sets trusted peer's ID.

func (*Trust) SetValue

func (x *Trust) SetValue(v float64)

SetValue sets trust value.

func (*Trust) StableMarshal

func (x *Trust) StableMarshal(buf []byte) []byte

func (*Trust) StableSize

func (x *Trust) StableSize() (size int)

func (*Trust) ToGRPCMessage

func (x *Trust) ToGRPCMessage() grpc.Message

ToGRPCMessage converts Trust to gRPC-generated reputation.Trust message.

func (*Trust) Unmarshal

func (x *Trust) Unmarshal(data []byte) error

func (*Trust) UnmarshalJSON

func (x *Trust) UnmarshalJSON(data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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