Versions in this module Expand all Collapse all v0 v0.0.2 Oct 31, 2023 Changes in this version + var ErrMessageTooNew = errors.New("message is too new") + var ErrMessageTooOld = errors.New("message is too old") + var ErrNilSyncTimer = errors.New("nil sync timer") + var ErrUnsupportedFields = errors.New("unsupported fields") + var ErrUnsupportedMessageVersion = errors.New("unsupported message version") + type SyncTimer interface + CurrentTime func() time.Time + IsInterfaceNil func() bool v0.0.1 Oct 30, 2023 Changes in this version + const ListsSharder + const NilListSharder + const OneListSharder + var ErrAlreadySeenMessage = errors.New("already seen this message") + var ErrChannelCanNotBeDeleted = errors.New("channel can not be deleted") + var ErrChannelCanNotBeReAdded = errors.New("channel can not be re added") + var ErrChannelDoesNotExist = errors.New("channel does not exist") + var ErrEmptyBuffer = errors.New("empty buffer") + var ErrEmptyBufferToSend = errors.New("empty buffer to send") + var ErrEmptySeed = errors.New("empty seed") + var ErrEmptyTopicList = errors.New("empty topicIDs") + var ErrEndPortIsSmallerThanStartPort = errors.New("ending port value is smaller than the starting port value") + var ErrInvalidDurationProvided = errors.New("invalid time.Duration provided") + var ErrInvalidEndingPortValue = errors.New("invalid ending port value") + var ErrInvalidPortValue = errors.New("invalid port value") + var ErrInvalidPortsRangeString = errors.New("invalid ports range string") + var ErrInvalidStartingPortValue = errors.New("invalid starting port value") + var ErrInvalidValue = errors.New("invalid value") + var ErrMessageTooLarge = errors.New("buffer too large") + var ErrMessageUnmarshalError = errors.New("message unmarshal error") + var ErrNilContext = errors.New("nil context") + var ErrNilDirectSendMessageHandler = errors.New("nil direct sender message handler") + var ErrNilFetchPeersOnTopicHandler = errors.New("nil fetch peers on topic handler") + var ErrNilHost = errors.New("nil host") + var ErrNilMarshalizer = errors.New("nil marshalizer") + var ErrNilMessage = errors.New("nil message") + var ErrNilMockNet = errors.New("nil mocknet provided") + var ErrNilNetworkShardingCollector = errors.New("nil network sharding collector") + var ErrNilPeerDenialEvaluator = errors.New("nil peer denial evaluator") + var ErrNilPeerShardResolver = errors.New("nil PeerShardResolver") + var ErrNilReconnecter = errors.New("nil reconnecter") + var ErrNilSharder = errors.New("nil sharder") + var ErrNilSignerVerifier = errors.New("nil signer-verifier") + var ErrNilStatusHandler = errors.New("nil status handler") + var ErrNilTopic = errors.New("nil topic") + var ErrNilValidator = errors.New("no validator has been set for this topic") + var ErrNoFreePortInRange = errors.New("no free port in range") + var ErrOldMessage = errors.New("message too old") + var ErrPeerDiscoveryProcessAlreadyStarted = errors.New("peer discovery is already turned on") + var ErrPeerNotDirectlyConnected = errors.New("peer is not directly connected") + var ErrTooManyGoroutines = errors.New(" number of goroutines exceeded") + var ErrTopicAlreadyExists = errors.New("topic already exists") + var ErrTopicValidatorOperationNotSupported = errors.New("topic validator operation is not supported") + var ErrUnwantedPeer = errors.New("unwanted peer: will not initiate connection as it will get disconnected") + var ErrWrongTypeAssertion = errors.New("wrong type assertion") + func MessageOriginatorPid(msg MessageP2P) string + func MessageOriginatorSeq(msg MessageP2P) string + func PeerIdToShortString(pid core.PeerID) string + type Cacher interface + HasOrAdd func(key []byte, value interface{}, sizeInBytes int) (has, added bool) + IsInterfaceNil func() bool + type ChannelLoadBalancer interface + AddChannel func(channel string) error + Close func() error + CollectOneElementFromChannels func() *SendableData + GetChannelOrDefault func(channel string) chan *SendableData + IsInterfaceNil func() bool + RemoveChannel func(channel string) error + type CommonSharder interface + IsInterfaceNil func() bool + SetPeerShardResolver func(psp PeerShardResolver) error + type ConnectedPeersInfo struct + CrossShardObservers []string + CrossShardValidators []string + IntraShardObservers []string + IntraShardValidators []string + UnknownPeers []string + type ConnectionMonitorWrapper interface + CheckConnectionsBlocking func() + IsInterfaceNil func() bool + PeerDenialEvaluator func() PeerDenialEvaluator + SetPeerDenialEvaluator func(handler PeerDenialEvaluator) error + type Debugger interface + AddIncomingMessage func(topic string, size uint64, isRejected bool) + AddOutgoingMessage func(topic string, size uint64, isRejected bool) + Close func() error + IsInterfaceNil func() bool + type DirectSender interface + IsInterfaceNil func() bool + NextSeqno func(counter *uint64) []byte + Send func(topic string, buff []byte, peer core.PeerID) error + type Marshalizer interface + IsInterfaceNil func() bool + Marshal func(obj interface{}) ([]byte, error) + Unmarshal func(obj interface{}, buff []byte) error + type MessageP2P interface + Data func() []byte + From func() []byte + IsInterfaceNil func() bool + Key func() []byte + Payload func() []byte + Peer func() core.PeerID + SeqNo func() []byte + Signature func() []byte + Timestamp func() int64 + Topics func() []string + type MessageProcessor interface + IsInterfaceNil func() bool + ProcessReceivedMessage func(message MessageP2P, fromConnectedPeer core.PeerID) error + type Messenger interface + Addresses func() []string + Bootstrap func() error + Broadcast func(topic string, buff []byte) + BroadcastOnChannel func(channel string, topic string, buff []byte) + BroadcastOnChannelBlocking func(channel string, topic string, buff []byte) error + ConnectToPeer func(address string) error + ConnectedAddresses func() []string + ConnectedPeers func() []core.PeerID + ConnectedPeersOnTopic func(topic string) []core.PeerID + CreateTopic func(name string, createChannelForTopic bool) error + GetConnectedPeersInfo func() *ConnectedPeersInfo + HasTopic func(name string) bool + HasTopicValidator func(name string) bool + ID func() core.PeerID + IsConnected func(peerID core.PeerID) bool + IsConnectedToTheNetwork func() bool + IsInterfaceNil func() bool + PeerAddresses func(pid core.PeerID) []string + Peers func() []core.PeerID + RegisterMessageProcessor func(topic string, handler MessageProcessor) error + SendToConnectedPeer func(topic string, buff []byte, peerID core.PeerID) error + SetPeerDenialEvaluator func(handler PeerDenialEvaluator) error + SetPeerShardResolver func(peerShardResolver PeerShardResolver) error + SetThresholdMinConnectedPeers func(minConnectedPeers int) error + ThresholdMinConnectedPeers func() int + UnjoinAllTopics func() error + UnregisterAllMessageProcessors func() error + UnregisterMessageProcessor func(topic string) error + type NetworkShardingCollector interface + IsInterfaceNil func() bool + UpdatePeerIdPublicKey func(pid core.PeerID, pk []byte) + type PeerCounts struct + CrossShardPeers int + IntraShardPeers int + UnknownPeers int + type PeerDenialEvaluator interface + IsDenied func(pid core.PeerID) bool + IsInterfaceNil func() bool + UpsertPeerID func(pid core.PeerID, duration time.Duration) error + type PeerDiscoverer interface + Bootstrap func() error + IsInterfaceNil func() bool + Name func() string + type PeerDiscoveryFactory interface + CreatePeerDiscoverer func() (PeerDiscoverer, error) + IsInterfaceNil func() bool + type PeerShardResolver interface + GetPeerInfo func(pid core.PeerID) core.P2PPeerInfo + IsInterfaceNil func() bool + type Reconnecter interface + IsInterfaceNil func() bool + ReconnectToNetwork func() <-chan struct{} + type SendableData struct + Buff []byte + Topic string + type SignerVerifier interface + IsInterfaceNil func() bool + PublicKey func() []byte + Sign func(message []byte) ([]byte, error) + Verify func(message []byte, sig []byte, pk []byte) error