Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultDiscoveryInterval = time.Minute * 10
DiscoveryInterval is how often we re-publish our mDNS records.
View Source
const DefaultDiscoveryServiceTag = "pubsub"
DiscoveryServiceTag is used in our mDNS advertisements to discover other chat peers.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel struct {
Messages chan ChannelMessage
// contains filtered or unexported fields
}
func NewChannel ¶
func (*Channel) ListPeers ¶
ListPeers returns a list of peers we are connected to in the given topic.
type ChannelMessage ¶
ChannelMessage represents a message to send
type DiscoveryOptions ¶
type LibP2pNodeOptions ¶
type LibP2pNodeOptions struct {
Addr []string
Discovery DiscoveryOptions
Mux MuxOptions
Sec SecurityOptions
Raw []libp2p.Option
}
func DefaultLibP2pNodeOptions ¶
func DefaultLibP2pNodeOptions() *LibP2pNodeOptions
func NewLibP2pNodeOptions ¶
func NewLibP2pNodeOptions(disc DiscoveryOptions) *LibP2pNodeOptions
type MuxOptions ¶
type MuxOptions struct {
Name string
Transport mux.Multiplexer
}
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func NewLibP2pNode ¶
func NewLibP2pNode(ctx context.Context, opts *LibP2pNodeOptions) (*Node, error)
type OnPeerFound ¶
type SecurityOptions ¶
type SecurityOptions struct {
Name string
Transport interface{}
}
Click to show internal directories.
Click to hide internal directories.