Documentation ¶
Index ¶
- func MakeRelayAddrs(relayID, destID string) (ma.Multiaddr, error)
- func ReserveRelaySlot(ctx context.Context, host host.Host, relayInfo peer.AddrInfo, ...)
- func WithRelayAddrs(relays []string) config.AddrsFactory
- type MDNS
- type PubSub
- func (p *PubSub) FetchTopicPeers(topic string) []peer.ID
- func (p *PubSub) HasTopic(topic string) bool
- func (p *PubSub) JoinAndSubTopic(topic string, callback SubCallBack, opts ...pubsub.TopicOpt) error
- func (p *PubSub) JoinTopic(topic string, opts ...pubsub.TopicOpt) error
- func (p *PubSub) Publish(topic string, msg []byte) error
- func (p *PubSub) RemoveTopic(topic string)
- func (p *PubSub) TopicNum() int
- func (p *PubSub) TryJoinTopic(topic string, opts ...pubsub.TopicOpt) error
- type Relay
- type SubCallBack
- type SubMsg
- type TopicMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeRelayAddrs ¶ added in v1.68.1
MakeRelayAddrs 把中继ID和与目的节点的ID 组装为一个新的地址
func ReserveRelaySlot ¶ added in v1.68.1
func ReserveRelaySlot(ctx context.Context, host host.Host, relayInfo peer.AddrInfo, timeout time.Duration)
ReserveRelaySlot reserve relay slot
func WithRelayAddrs ¶
func WithRelayAddrs(relays []string) config.AddrsFactory
Types ¶
type PubSub ¶
PubSub pub sub
func (*PubSub) FetchTopicPeers ¶
FetchTopicPeers fetch peers with topic
func (*PubSub) JoinAndSubTopic ¶
JoinAndSubTopic 加入topic&subTopic
type Relay ¶
type Relay struct {
// contains filtered or unexported fields
}
Relay p2p relay
func MakeNodeRelayService ¶ added in v1.68.1
MakeNodeRelayService provide relay services
Click to show internal directories.
Click to hide internal directories.