Documentation ¶
Index ¶
- type ConnGaterSet
- func (c *ConnGaterSet) Add(connGaters ...connmgr.ConnectionGater)
- func (c *ConnGaterSet) InterceptAccept(network network.ConnMultiaddrs) bool
- func (c *ConnGaterSet) InterceptAddrDial(id peer.ID, addr multiaddr.Multiaddr) bool
- func (c *ConnGaterSet) InterceptPeerDial(id peer.ID) bool
- func (c *ConnGaterSet) InterceptSecured(dir network.Direction, id peer.ID, network network.ConnMultiaddrs) bool
- func (c *ConnGaterSet) InterceptUpgraded(conn network.Conn) (bool, control.DisconnectReason)
- type MessageHandler
- type MessageHandlerSet
- type NodeConfiguredEvent
- type NodeEventHandler
- type NodeEventHandlerFunc
- type NodeEventHandlerSet
- type NodeHostStartedEvent
- type NodePubSubStartedEvent
- type NodeStartedEvent
- type NodeStartingEvent
- type NodeStoppedEvent
- type NodeStoppingEvent
- type NodeTopicSubscribedEvent
- type NodeTopicUnsubscribedEvent
- type NotifeeSet
- func (n *NotifeeSet) Add(notifees ...network.Notifiee)
- func (n *NotifeeSet) ClosedStream(network network.Network, stream network.Stream)
- func (n *NotifeeSet) Connected(network network.Network, conn network.Conn)
- func (n *NotifeeSet) Disconnected(network network.Network, conn network.Conn)
- func (n *NotifeeSet) Listen(network network.Network, maddr multiaddr.Multiaddr)
- func (n *NotifeeSet) ListenClose(network network.Network, maddr multiaddr.Multiaddr)
- func (n *NotifeeSet) OpenedStream(network network.Network, stream network.Stream)
- func (n *NotifeeSet) Remove(notifees ...network.Notifiee)
- type PubSubEventHandler
- type PubSubEventHandlerFunc
- type PubSubEventHandlerSet
- type Validator
- type ValidatorSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnGaterSet ¶
type ConnGaterSet struct {
// contains filtered or unexported fields
}
ConnGaterSet implements the connmgr.ConnectionGater and allow to aggregate multiple instances of this interface.
func NewConnGaterSet ¶
func NewConnGaterSet() *ConnGaterSet
NewConnGaterSet creates new instance of the ConnGaterSet.
func (*ConnGaterSet) Add ¶
func (c *ConnGaterSet) Add(connGaters ...connmgr.ConnectionGater)
Add adds new connmgr.ConnectionGater to the set.
func (*ConnGaterSet) InterceptAccept ¶
func (c *ConnGaterSet) InterceptAccept(network network.ConnMultiaddrs) bool
InterceptAccept implements the connmgr.ConnectionGater interface.
func (*ConnGaterSet) InterceptAddrDial ¶
func (c *ConnGaterSet) InterceptAddrDial(id peer.ID, addr multiaddr.Multiaddr) bool
InterceptAddrDial implements the connmgr.ConnectionGater interface.
func (*ConnGaterSet) InterceptPeerDial ¶
func (c *ConnGaterSet) InterceptPeerDial(id peer.ID) bool
InterceptPeerDial implements the connmgr.ConnectionGater interface.
func (*ConnGaterSet) InterceptSecured ¶
func (c *ConnGaterSet) InterceptSecured(dir network.Direction, id peer.ID, network network.ConnMultiaddrs) bool
InterceptSecured implements the connmgr.ConnectionGater interface.
func (*ConnGaterSet) InterceptUpgraded ¶
func (c *ConnGaterSet) InterceptUpgraded(conn network.Conn) (bool, control.DisconnectReason)
InterceptUpgraded implements the connmgr.ConnectionGater interface.
type MessageHandler ¶
type MessageHandler interface { // Published is called when new message is published. Published(topic string, msg []byte) // Received is called when new message is received. Received(topic string, msg *pubsub.Message, result pubsub.ValidationResult) }
MessageHandler can ba implemented by type that supports handling the PubSub system messages.
type MessageHandlerSet ¶
type MessageHandlerSet struct {
// contains filtered or unexported fields
}
MessageHandlerSet stores multiple instances of the MessageHandler interface.
func NewMessageHandlerSet ¶
func NewMessageHandlerSet() *MessageHandlerSet
NewMessageHandlerSet creates new instance of the MessageHandlerSet.
func (*MessageHandlerSet) Add ¶
func (n *MessageHandlerSet) Add(messageHandler ...MessageHandler)
Add adds new MessageHandler to the set.
func (*MessageHandlerSet) Published ¶
func (n *MessageHandlerSet) Published(topic string, msg []byte)
Published invokes all registered handlers.
func (*MessageHandlerSet) Received ¶
func (n *MessageHandlerSet) Received(topic string, msg *pubsub.Message, result pubsub.ValidationResult)
Received invokes all registered handlers.
type NodeConfiguredEvent ¶
type NodeConfiguredEvent struct{}
type NodeEventHandler ¶
type NodeEventHandler interface {
// Handle is called on a new event.
Handle(event interface{})
}
NodeEventHandler can ba implemented by type that supports handling the Node system events.
type NodeEventHandlerFunc ¶
type NodeEventHandlerFunc func(event interface{})
NodeEventHandlerFunc is a adapter for the NodeEventHandler interface.
func (NodeEventHandlerFunc) Handle ¶
func (f NodeEventHandlerFunc) Handle(event interface{})
Handle calls f(topic, event).
type NodeEventHandlerSet ¶
type NodeEventHandlerSet struct {
// contains filtered or unexported fields
}
NodeEventHandlerSet stores multiple instances of the NodeEventHandler interface.
func NewNodeEventHandlerSet ¶
func NewNodeEventHandlerSet() *NodeEventHandlerSet
NewNodeEventHandlerSet creates new instance of the NodeEventHandlerSet.
func (*NodeEventHandlerSet) Add ¶
func (n *NodeEventHandlerSet) Add(eventHandler ...NodeEventHandler)
Add adds new NodeEventHandler to the set.
func (*NodeEventHandlerSet) Handle ¶
func (n *NodeEventHandlerSet) Handle(event interface{})
Handle invokes all registered handlers for given topic.
type NodeHostStartedEvent ¶
type NodeHostStartedEvent struct{}
type NodePubSubStartedEvent ¶
type NodePubSubStartedEvent struct{}
type NodeStartedEvent ¶
type NodeStartedEvent struct{}
type NodeStartingEvent ¶
type NodeStartingEvent struct{}
type NodeStoppedEvent ¶
type NodeStoppedEvent struct{}
type NodeStoppingEvent ¶
type NodeStoppingEvent struct{}
type NodeTopicSubscribedEvent ¶
type NodeTopicSubscribedEvent struct{ Topic string }
type NodeTopicUnsubscribedEvent ¶
type NodeTopicUnsubscribedEvent struct{ Topic string }
type NotifeeSet ¶
type NotifeeSet struct {
// contains filtered or unexported fields
}
NotifeeSet implements the network.Notifiee and allow to aggregate multiple instances of this interface.
func NewNotifeeSet ¶
func NewNotifeeSet() *NotifeeSet
NewNotifeeSet creates new instance of the NotifeeSet.
func (*NotifeeSet) Add ¶
func (n *NotifeeSet) Add(notifees ...network.Notifiee)
Add adds new network.Notifiee to the set.
func (*NotifeeSet) ClosedStream ¶
func (n *NotifeeSet) ClosedStream(network network.Network, stream network.Stream)
ClosedStream implements the network.Notifiee interface.
func (*NotifeeSet) Connected ¶
func (n *NotifeeSet) Connected(network network.Network, conn network.Conn)
Connected implements the network.Notifiee interface.
func (*NotifeeSet) Disconnected ¶
func (n *NotifeeSet) Disconnected(network network.Network, conn network.Conn)
Disconnected implements the network.Notifiee interface.
func (*NotifeeSet) Listen ¶
func (n *NotifeeSet) Listen(network network.Network, maddr multiaddr.Multiaddr)
Listen implements the network.Notifiee interface.
func (*NotifeeSet) ListenClose ¶
func (n *NotifeeSet) ListenClose(network network.Network, maddr multiaddr.Multiaddr)
ListenClose implements the network.Notifiee interface.
func (*NotifeeSet) OpenedStream ¶
func (n *NotifeeSet) OpenedStream(network network.Network, stream network.Stream)
OpenedStream implements the network.Notifiee interface.
func (*NotifeeSet) Remove ¶
func (n *NotifeeSet) Remove(notifees ...network.Notifiee)
Remove removes network.Notifiee from the set if already added.
type PubSubEventHandler ¶
type PubSubEventHandler interface { // Handle is called on a new event. Handle(topic string, event pubsub.PeerEvent) }
PubSubEventHandler can ba implemented by type that supports handling the PubSub system events.
type PubSubEventHandlerFunc ¶
PubSubEventHandlerFunc is a adapter for the PubSubEventHandler interface.
type PubSubEventHandlerSet ¶
type PubSubEventHandlerSet struct {
// contains filtered or unexported fields
}
PubSubEventHandlerSet stores multiple instances of the PubSubEventHandler interface.
func NewPubSubEventHandlerSet ¶
func NewPubSubEventHandlerSet() *PubSubEventHandlerSet
NewPubSubEventHandlerSet creates new instance of the PubSubEventHandlerSet.
func (*PubSubEventHandlerSet) Add ¶
func (n *PubSubEventHandlerSet) Add(eventHandler ...PubSubEventHandler)
Add adds new PubSubEventHandler to the set.
type ValidatorSet ¶
type ValidatorSet struct {
// contains filtered or unexported fields
}
ValidatorSet stores multiple instances of validators that implements the pubsub.ValidatorEx functions. Validators are groped by topic.
func NewValidatorSet ¶
func NewValidatorSet() *ValidatorSet
NewValidatorSet creates new instance of the ValidatorSet.
func (*ValidatorSet) Add ¶
func (n *ValidatorSet) Add(validator ...Validator)
Add adds new pubsub.ValidatorEx to the set.
func (*ValidatorSet) Validator ¶
func (n *ValidatorSet) Validator(topic string) pubsub.ValidatorEx
Validator returns function that implements pubsub.ValidatorEx. That function will invoke all registered validators for given topic.