Documentation ¶
Index ¶
- Constants
- func DefaultMuxer() mux.Transport
- func Defaults(cfg *Config) error
- func New(ctx context.Context, opts ...Option) (host.Host, error)
- type Config
- type Option
- func BandwidthReporter(rep metrics.Reporter) Option
- func Identity(sk crypto.PrivKey) Option
- func ListenAddrStrings(s ...string) Option
- func ListenAddrs(addrs ...ma.Multiaddr) Option
- func Muxer(m mux.Transport) Option
- func NATPortMap() Option
- func NoEncryption() Option
- func Peerstore(ps pstore.Peerstore) Option
- func PrivateNetwork(prot pnet.Protector) Option
- func TransportEncryption(tenc ...transportEncOpt) Option
- func Transports(tpts ...transport.Transport) Option
Constants ¶
View Source
const ( EncPlaintext = transportEncOpt(0) EncSecio = transportEncOpt(1) )
Variables ¶
This section is empty.
Functions ¶
func DefaultMuxer ¶
Types ¶
type Config ¶
type Config struct { Transports []transport.Transport Muxer mux.Transport ListenAddrs []ma.Multiaddr PeerKey crypto.PrivKey Peerstore pstore.Peerstore Protector pnet.Protector Reporter metrics.Reporter DisableSecio bool EnableNAT bool }
Config describes a set of settings for a libp2p node
type Option ¶
func BandwidthReporter ¶
func ListenAddrStrings ¶
func ListenAddrs ¶
func NATPortMap ¶
func NATPortMap() Option
func NoEncryption ¶
func NoEncryption() Option
func PrivateNetwork ¶
func TransportEncryption ¶
func TransportEncryption(tenc ...transportEncOpt) Option
func Transports ¶
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
multipro/pb
Package protocols_p2p is a generated protocol buffer package.
|
Package protocols_p2p is a generated protocol buffer package. |
p2p
|
|
net/mock
Package mocknet provides a mock net.Network to test with.
|
Package mocknet provides a mock net.Network to test with. |
protocol/identify/pb
Package identify_pb is a generated protocol buffer package.
|
Package identify_pb is a generated protocol buffer package. |
test/reconnects
Package reconnect tests connect -> disconnect -> reconnect works
|
Package reconnect tests connect -> disconnect -> reconnect works |
Click to show internal directories.
Click to hide internal directories.