Documentation ¶
Index ¶
- func AliveMessageToString(am *gossip.AliveMessage) string
- func DataDigestToString(dig *gossip.DataDigest) string
- func DataRequestToString(dataReq *gossip.DataRequest) string
- func DataUpdateToString(du *gossip.DataUpdate) string
- func GetPullMsgType(m *gossip.GossipMessage) gossip.PullMsgType
- func InternalEndpoint(s *gossip.SecretEnvelope) string
- func IsAck(m *gossip.GossipMessage) bool
- func IsAliveMsg(m *gossip.GossipMessage) bool
- func IsChannelRestricted(m *gossip.GossipMessage) bool
- func IsDataMsg(m *gossip.GossipMessage) bool
- func IsDataReq(m *gossip.GossipMessage) bool
- func IsDataUpdate(m *gossip.GossipMessage) bool
- func IsDigestMsg(m *gossip.GossipMessage) bool
- func IsHelloMsg(m *gossip.GossipMessage) bool
- func IsIdentityMsg(m *gossip.GossipMessage) bool
- func IsLeadershipMsg(m *gossip.GossipMessage) bool
- func IsOrgRestricted(m *gossip.GossipMessage) bool
- func IsPrivateDataMsg(m *gossip.GossipMessage) bool
- func IsPullMsg(m *gossip.GossipMessage) bool
- func IsRemoteStateMessage(m *gossip.GossipMessage) bool
- func IsStateInfoMsg(m *gossip.GossipMessage) bool
- func IsStateInfoPullRequestMsg(m *gossip.GossipMessage) bool
- func IsStateInfoSnapshot(m *gossip.GossipMessage) bool
- func IsTagLegal(m *gossip.GossipMessage) error
- func LeadershipMessageToString(lm *gossip.LeadershipMessage) string
- func MemberToString(m *gossip.Member) string
- func MembershipRequestToString(mr *gossip.MembershipRequest) string
- func MembershipResponseToString(mr *gossip.MembershipResponse) string
- func NewGossipMessageComparator(dataBlockStorageSize int) common.MessageReplacingPolicy
- func PayloadToString(p *gossip.Payload) string
- func RemovePvtDataResponseToString(res *gossip.RemotePvtDataResponse) string
- func SignSecret(e *gossip.Envelope, signer Signer, secret *gossip.Secret) error
- func StateInfoPullRequestToString(sipr *gossip.StateInfoPullRequest) string
- func StateInfoSnapshotToString(sis *gossip.StateInfoSnapshot) string
- func StateInfoToString(si *gossip.StateInfo) string
- type AuthInfo
- type ConnectionInfo
- type ReceivedMessage
- type SignedGossipMessage
- type Signer
- type Verifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AliveMessageToString ¶
func AliveMessageToString(am *gossip.AliveMessage) string
AliveMessageToString of AliveMessage prints Alive Message, Identity and Timestamp
func DataDigestToString ¶
func DataDigestToString(dig *gossip.DataDigest) string
DataDigestToString prints nonce, msg_type and digests
func DataRequestToString ¶
func DataRequestToString(dataReq *gossip.DataRequest) string
DataRequestToString prints nonce, msg_type and digests
func DataUpdateToString ¶
func DataUpdateToString(du *gossip.DataUpdate) string
DataUpdateToString prints Type, items and nonce
func GetPullMsgType ¶
func GetPullMsgType(m *gossip.GossipMessage) gossip.PullMsgType
GetPullMsgType returns the phase of the pull mechanism this GossipMessage belongs to for example: Hello, Digest, etc. If this isn't a pull message, PullMsgType_UNDEFINED is returned.
func InternalEndpoint ¶
func InternalEndpoint(s *gossip.SecretEnvelope) string
InternalEndpoint returns the internal endpoint in the secret envelope, or an empty string if a failure occurs.
func IsAck ¶
func IsAck(m *gossip.GossipMessage) bool
IsAck returns whether this GossipMessage is an acknowledgement
func IsAliveMsg ¶
func IsAliveMsg(m *gossip.GossipMessage) bool
IsAliveMsg returns whether this GossipMessage is an AliveMessage
func IsChannelRestricted ¶
func IsChannelRestricted(m *gossip.GossipMessage) bool
IsChannelRestricted returns whether this GossipMessage should be routed only in its channel
func IsDataMsg ¶
func IsDataMsg(m *gossip.GossipMessage) bool
IsDataMsg returns whether this GossipMessage is a data message
func IsDataReq ¶
func IsDataReq(m *gossip.GossipMessage) bool
IsDataReq returns whether this GossipMessage is a data request message
func IsDataUpdate ¶
func IsDataUpdate(m *gossip.GossipMessage) bool
IsDataUpdate returns whether this GossipMessage is a data update message
func IsDigestMsg ¶
func IsDigestMsg(m *gossip.GossipMessage) bool
IsDigestMsg returns whether this GossipMessage is a digest message
func IsHelloMsg ¶
func IsHelloMsg(m *gossip.GossipMessage) bool
IsHelloMsg returns whether this GossipMessage is a hello message
func IsIdentityMsg ¶
func IsIdentityMsg(m *gossip.GossipMessage) bool
IsIdentityMsg returns whether this GossipMessage is an identity message
func IsLeadershipMsg ¶
func IsLeadershipMsg(m *gossip.GossipMessage) bool
IsLeadershipMsg returns whether this GossipMessage is a leadership (leader election) message
func IsOrgRestricted ¶
func IsOrgRestricted(m *gossip.GossipMessage) bool
IsOrgRestricted returns whether this GossipMessage should be routed only inside the organization
func IsPrivateDataMsg ¶
func IsPrivateDataMsg(m *gossip.GossipMessage) bool
IsPrivateDataMsg returns whether this message is related to private data
func IsPullMsg ¶
func IsPullMsg(m *gossip.GossipMessage) bool
IsPullMsg returns whether this GossipMessage is a message that belongs to the pull mechanism
func IsRemoteStateMessage ¶
func IsRemoteStateMessage(m *gossip.GossipMessage) bool
IsRemoteStateMessage returns whether this GossipMessage is related to state synchronization
func IsStateInfoMsg ¶
func IsStateInfoMsg(m *gossip.GossipMessage) bool
IsStateInfoMsg returns whether this GossipMessage is a stateInfo message
func IsStateInfoPullRequestMsg ¶
func IsStateInfoPullRequestMsg(m *gossip.GossipMessage) bool
IsStateInfoPullRequestMsg returns whether this GossipMessage is a stateInfoPullRequest
func IsStateInfoSnapshot ¶
func IsStateInfoSnapshot(m *gossip.GossipMessage) bool
IsStateInfoSnapshot returns whether this GossipMessage is a stateInfo snapshot
func IsTagLegal ¶
func IsTagLegal(m *gossip.GossipMessage) error
IsTagLegal checks the GossipMessage tags and inner type and returns an error if the tag doesn't match the type.
func LeadershipMessageToString ¶
func LeadershipMessageToString(lm *gossip.LeadershipMessage) string
LeadershipMessageToString prints PKI-id, Timestamp and Is Declaration
func MemberToString ¶
MemberToString prints Endpoint and PKI-id
func MembershipRequestToString ¶
func MembershipRequestToString(mr *gossip.MembershipRequest) string
MembershipRequestToString prints self information
func MembershipResponseToString ¶
func MembershipResponseToString(mr *gossip.MembershipResponse) string
MembershipResponseToString of MembershipResponse prints number of Alive and number of Dead
func NewGossipMessageComparator ¶
func NewGossipMessageComparator(dataBlockStorageSize int) common.MessageReplacingPolicy
NewGossipMessageComparator creates a MessageReplacingPolicy given a maximum number of blocks to hold
func PayloadToString ¶
PayloadToString prints Block message: Data and seq
func RemovePvtDataResponseToString ¶
func RemovePvtDataResponseToString(res *gossip.RemotePvtDataResponse) string
RemovePvtDataResponseToString returns a string representation of this RemotePvtDataResponse
func SignSecret ¶
SignSecret signs the secret payload and creates a secret envelope out of it.
func StateInfoPullRequestToString ¶
func StateInfoPullRequestToString(sipr *gossip.StateInfoPullRequest) string
StateInfoPullRequestToString prints Channel MAC
func StateInfoSnapshotToString ¶
func StateInfoSnapshotToString(sis *gossip.StateInfoSnapshot) string
StateInfoSnapshotToString prints items
Types ¶
type AuthInfo ¶
AuthInfo represents the authentication data that was provided by the remote peer at the connection time
type ConnectionInfo ¶
type ConnectionInfo struct { ID common.PKIidType Auth *AuthInfo Identity api.PeerIdentityType Endpoint string }
ConnectionInfo represents information about the remote peer that sent a certain ReceivedMessage
func (*ConnectionInfo) String ¶
func (c *ConnectionInfo) String() string
String returns a string representation of this ConnectionInfo
type ReceivedMessage ¶
type ReceivedMessage interface { // Respond sends a GossipMessage to the origin from which this ReceivedMessage was sent from Respond(msg *gossip.GossipMessage) // GetGossipMessage returns the underlying GossipMessage GetGossipMessage() *SignedGossipMessage // GetSourceMessage Returns the Envelope the ReceivedMessage was // constructed with GetSourceEnvelope() *gossip.Envelope // GetConnectionInfo returns information about the remote peer // that sent the message GetConnectionInfo() *ConnectionInfo // Ack returns to the sender an acknowledgement for the message // An ack can receive an error that indicates that the operation related // to the message has failed Ack(err error) }
ReceivedMessage is a GossipMessage wrapper that enables the user to send a message to the origin from which the ReceivedMessage was sent from. It also allows to know the identity of the sender, to obtain the raw bytes the GossipMessage was un-marshaled from, and the signature over these raw bytes.
type SignedGossipMessage ¶
type SignedGossipMessage struct { *gossip.Envelope *gossip.GossipMessage }
SignedGossipMessage contains a GossipMessage and the Envelope from which it came from
func EnvelopeToGossipMessage ¶
func EnvelopeToGossipMessage(e *gossip.Envelope) (*SignedGossipMessage, error)
EnvelopeToGossipMessage un-marshals a given envelope and creates a SignedGossipMessage out of it. Returns an error if un-marshaling fails.
func NoopSign ¶
func NoopSign(m *gossip.GossipMessage) (*SignedGossipMessage, error)
NoopSign creates a SignedGossipMessage with a nil signature
func (*SignedGossipMessage) IsSigned ¶
func (m *SignedGossipMessage) IsSigned() bool
IsSigned returns whether the message has a signature in the envelope.
func (*SignedGossipMessage) Sign ¶
func (m *SignedGossipMessage) Sign(signer Signer) (*gossip.Envelope, error)
Sign signs a GossipMessage with given Signer. Returns an Envelope on success, panics on failure.
func (*SignedGossipMessage) String ¶
func (m *SignedGossipMessage) String() string
String returns a string representation of a SignedGossipMessage
func (*SignedGossipMessage) Verify ¶
func (m *SignedGossipMessage) Verify(peerIdentity []byte, verify Verifier) error
Verify verifies a signed GossipMessage with a given Verifier. Returns nil on success, error on failure.
type Signer ¶
Signer signs a message, and returns (signature, nil) on success, and nil and an error on failure.