Versions in this module Expand all Collapse all v0 v0.0.1 Jul 8, 2020 Changes in this version + const DefaultDiscoveryInterval + const DefaultDiscoveryServiceTag + type Channel struct + Messages chan ChannelMessage + func NewChannel(ctx context.Context, node *Node, name string) (*Channel, error) + func (c *Channel) ListPeers() []peer.ID + func (c *Channel) Listen() + func (c *Channel) Publish(data []byte, mtype string) error + type ChannelMessage struct + Data []byte + Type string + type LibP2pNodeOptions struct + Addr []string + Ctx context.Context + DiscoveryInterval time.Duration + DiscoveryServiceTag string + OnPeerFound OnPeerFound + type Node struct + func NewLibP2pNode(opts *LibP2pNodeOptions) (*Node, error) + func (n *Node) Channel(name string) (cn *Channel, err error) + func (n *Node) Close() error + func (n *Node) ID() string + type OnPeerFound = func(pi peer.AddrInfo) bool