Documentation
¶
Index ¶
- Variables
- type Callbacks
- type ContentListener
- type Gossiper
- func (g *Gossiper) DidReceivePull(version uint8, data []byte, from id.Signatory) (wire.Message, error)
- func (g *Gossiper) DidReceivePullAck(version uint8, data []byte, from id.Signatory) error
- func (g *Gossiper) DidReceivePush(version uint8, data []byte, from id.Signatory) (wire.Message, error)
- func (g *Gossiper) DidReceivePushAck(version uint8, data []byte, from id.Signatory) error
- func (g *Gossiper) Gossip(target, hash id.Hash)
- func (g *Gossiper) Run(ctx context.Context)
- func (g *Gossiper) Sync(subnet, hash id.Hash)
- type Listener
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultAlpha = 10 DefaultBias = 0.25 DefaultTimeout = 5 * time.Second )
Functions ¶
This section is empty.
Types ¶
type Callbacks ¶
Callbacks implements the Listener interface by deferring all logic to closures. Closures that are nil will be gracefully ignored.
type ContentListener ¶
type Gossiper ¶
type Gossiper struct {
// contains filtered or unexported fields
}
func (*Gossiper) DidReceivePull ¶
func (*Gossiper) DidReceivePullAck ¶
func (*Gossiper) DidReceivePush ¶
func (*Gossiper) DidReceivePushAck ¶
func (*Gossiper) Gossip ¶
Gossip a message throughout the network. The target can be the signatory in the DHT, or it can be a subnet in the DHT. If the target is a subnet, then the gossiper will attempt to deliver the message to all peers in the subnet. If the target is a signatory, then the gossiper will attempt to deliver the message to that specific peer. If the target is neither, the message will be dropped.
type Listener ¶
type Listener interface { ContentListener }
type Options ¶
func DefaultOptions ¶
func DefaultOptions() Options
func (Options) WithLogger ¶
func (opts Options) WithLogger(logger logrus.FieldLogger) Options
Click to show internal directories.
Click to hide internal directories.