Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMetadata ¶
NewMetadata helper method - generate message data shared between all node's p2p protocols messageId: unique for requests, copied from request for responses
func SendProtoMessage ¶
SendProtoMessage helper method - writes a protobuf go data object to a network stream data: reference of protobuf go data object to send (not the object itself) s: network stream to write the data to
Types ¶
type BallotProtocol ¶
type BallotProtocol struct {
// contains filtered or unexported fields
}
BallotProtocol type
func (*BallotProtocol) SubmitRequest ¶
func (sp *BallotProtocol) SubmitRequest(peerID peer.ID, subjectHash *subject.Hash, ch chan<- []string) bool
SubmitRequest ... TODO: use callback instead of channel
type IdentityProtocol ¶
type IdentityProtocol struct {
// contains filtered or unexported fields
}
IdentityProtocol type
func (*IdentityProtocol) SubmitRequest ¶
func (sp *IdentityProtocol) SubmitRequest(peerID peer.ID, subjectHash *subject.Hash, ch chan<- []string) bool
SubmitRequest ... TODO: use callback instead of channel
type Protocol ¶
type Protocol interface { SubmitRequest(peerID peer.ID, subjectHash *subject.Hash, ch chan<- []string) bool // contains filtered or unexported methods }
func NewBallotProtocol ¶
NewBallotProtocol ...
func NewIdentityProtocol ¶
NewIdentityProtocol ...
func NewProtocol ¶
func NewProtocol(t ProtocolType, context *context.Context) Protocol
NewProtocol .
func NewSubjectProtocol ¶
NewSubjectProtocol ...
type ProtocolType ¶
type ProtocolType int
const ( BallotProtocolType ProtocolType = 1 << iota IdentityProtocolType SubjectProtocolType )
type SubjectProtocol ¶
type SubjectProtocol struct {
// contains filtered or unexported fields
}
SubjectProtocol type
func (*SubjectProtocol) SubmitRequest ¶
func (sp *SubjectProtocol) SubmitRequest(peerID peer.ID, subjectHash *subject.Hash, ch chan<- []string) bool
SubmitRequest ... TODO: use callback instead of channel