Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ConnThreshold = 3 TruncateDuration = 5 * time.Minute )
ConnThreshold represents the minimum number of bootstrap peers we need a connection to.
Functions ¶
This section is empty.
Types ¶
type Advertiser ¶
type Advertiser struct {
// contains filtered or unexported fields
}
func NewAdvertiser ¶
func NewAdvertiser(h host.Host) *Advertiser
func (*Advertiser) Advertise ¶
func (a *Advertiser) Advertise(chanID int) error
Advertise broadcasts that we're providing data for the given code.
TODO: NewMdnsService also polls for peers. This is quite chatty, so we could extract the server-only logic.
func (Advertiser) DiscoveryID ¶ added in v0.3.1
DiscoveryID returns the string, that we use to advertise via mDNS and the DHT. See chanID above for more information. Using UnixNano for testing.
func (*Advertiser) Shutdown ¶
func (a *Advertiser) Shutdown()
func (Advertiser) TimeSlotStart ¶ added in v0.3.1
TimeSlotStart returns the time when the current time slot started.f
type Discoverer ¶
type Discoverer struct {
// contains filtered or unexported fields
}
func NewDiscoverer ¶
func NewDiscoverer(h host.Host) *Discoverer
func (*Discoverer) Discover ¶
func (d *Discoverer) Discover(chanID int, handler func(info peer.AddrInfo)) error
func (Discoverer) DiscoveryID ¶ added in v0.3.1
DiscoveryID returns the string, that we use to advertise via mDNS and the DHT. See chanID above for more information. Using UnixNano for testing.
func (*Discoverer) SetOffset ¶ added in v0.3.1
func (d *Discoverer) SetOffset(offset time.Duration) *Discoverer
func (*Discoverer) Shutdown ¶
func (d *Discoverer) Shutdown()
func (Discoverer) TimeSlotStart ¶ added in v0.3.1
TimeSlotStart returns the time when the current time slot started.f