Documentation ¶
Index ¶
- type PeerManager
- type Swarm
- func (swarm *Swarm) AsyncSend(id uint64, msg *pb.Message) error
- func (swarm *Swarm) Broadcast(msg *pb.Message) error
- func (swarm *Swarm) OtherPeers() map[uint64]*peer.AddrInfo
- func (swarm *Swarm) Peers() map[uint64]*peer.AddrInfo
- func (swarm *Swarm) Send(id uint64, msg *pb.Message) (*pb.Message, error)
- func (swarm *Swarm) SendWithStream(s network.Stream, msg *pb.Message) error
- func (swarm *Swarm) Start() error
- func (swarm *Swarm) Stop() error
- func (swarm *Swarm) SubscribeOrderMessage(ch chan<- events.OrderMessageEvent) event.Subscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PeerManager ¶
type PeerManager interface { // Start Start() error // Stop Stop() error // AsyncSend sends message to peer with peer info. AsyncSend(uint64, *pb.Message) error // SendWithStream sends message using existed stream SendWithStream(network.Stream, *pb.Message) error // Send sends message waiting response Send(uint64, *pb.Message) (*pb.Message, error) // Broadcast message to all node Broadcast(*pb.Message) error // Peers Peers() map[uint64]*peer.AddrInfo // OtherPeers OtherPeers() map[uint64]*peer.AddrInfo // SubscribeOrderMessage SubscribeOrderMessage(ch chan<- events.OrderMessageEvent) event.Subscription }
type Swarm ¶
type Swarm struct {
// contains filtered or unexported fields
}
func (*Swarm) SendWithStream ¶
func (*Swarm) SubscribeOrderMessage ¶
func (swarm *Swarm) SubscribeOrderMessage(ch chan<- events.OrderMessageEvent) event.Subscription
Click to show internal directories.
Click to hide internal directories.