Documentation ¶
Overview ¶
Package boot provides utilities for parsing and instantiating boot services
Index ¶
- Variables
- func Dial(h host.Host, maddr ma.Multiaddr, opt ...socket.Option) (discovery.Discoverer, error)
- func DialCIDR(h host.Host, maddr ma.Multiaddr, opt ...socket.Option) (*crawl.Crawler, error)
- func DialMulticast(h host.Host, maddr ma.Multiaddr, opt ...socket.Option) (*survey.Surveyor, error)
- func DialPortRange(h host.Host, maddr ma.Multiaddr, opt ...socket.Option) (*crawl.Crawler, error)
- func DialString(h host.Host, s string, opt ...socket.Option) (discovery.Discoverer, error)
- func IsCIDR(maddr ma.Multiaddr) bool
- func IsMulticast(maddr ma.Multiaddr) bool
- func IsP2P(maddr ma.Multiaddr) bool
- func IsPortRange(maddr ma.Multiaddr) bool
- func IsSurvey(maddr ma.Multiaddr) bool
- func Listen(h host.Host, maddr ma.Multiaddr, opt ...socket.Option) (discovery.Discovery, error)
- func ListenCIDR(h host.Host, maddr ma.Multiaddr, opt ...socket.Option) (*crawl.Crawler, error)
- func ListenString(h host.Host, s string, opt ...socket.Option) (discovery.Discovery, error)
- type Namespace
- type StaticAddrs
- func (as StaticAddrs) Advertise(_ context.Context, _ string, opt ...discovery.Option) (time.Duration, error)
- func (StaticAddrs) Close() error
- func (as StaticAddrs) Filter(f func(peer.AddrInfo) bool) StaticAddrs
- func (as StaticAddrs) FindPeers(_ context.Context, _ string, opt ...discovery.Option) (<-chan peer.AddrInfo, error)
- func (as StaticAddrs) Len() int
- func (as StaticAddrs) Less(i, j int) bool
- func (as StaticAddrs) Swap(i, j int)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnknownBootProto = errors.New("unknown boot protocol")
ErrUnknownBootProto is returned when the multiaddr passed to Parse does not contain a recognized boot protocol.
Functions ¶
func DialMulticast ¶
func DialPortRange ¶
func DialString ¶
func IsMulticast ¶
func IsPortRange ¶
IsPortRange returns true if maddr is a UDP address with no subprotocols. This function MAY be extended to support port ranges ranges in the near future.
func ListenCIDR ¶
Types ¶
type Namespace ¶
type Namespace struct { Match func(string) bool Target discovery.Discovery Default discovery.Discovery }
type StaticAddrs ¶
StaticAddrs is a set of bootstrap-peer addresses.
func NewStaticAddrStrings ¶
func NewStaticAddrStrings(ss ...string) (as StaticAddrs, _ error)
func NewStaticAddrs ¶
func NewStaticAddrs(as ...ma.Multiaddr) (StaticAddrs, error)
NewStaticAddrs from one or more multiaddrs.
func (StaticAddrs) Advertise ¶
func (as StaticAddrs) Advertise(_ context.Context, _ string, opt ...discovery.Option) (time.Duration, error)
Advertise is a nop that defaults to PermanentAddrTTL.
func (StaticAddrs) Close ¶
func (StaticAddrs) Close() error
Close is a nop method. It exists to satisfy boot.DiscoveryCloser.
func (StaticAddrs) Filter ¶
func (as StaticAddrs) Filter(f func(peer.AddrInfo) bool) StaticAddrs
func (StaticAddrs) FindPeers ¶
func (as StaticAddrs) FindPeers(_ context.Context, _ string, opt ...discovery.Option) (<-chan peer.AddrInfo, error)
FindPeers converts the static addresses into AddrInfos
func (StaticAddrs) Len ¶
func (as StaticAddrs) Len() int
func (StaticAddrs) Less ¶
func (as StaticAddrs) Less(i, j int) bool
func (StaticAddrs) Swap ¶
func (as StaticAddrs) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.