mock

package
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithBroadcastPeers

func WithBroadcastPeers(f func(context.Context, boson.Address, ...boson.Address) error) optionFunc

Types

type Discovery

type Discovery struct {
	// contains filtered or unexported fields
}

func NewDiscovery

func NewDiscovery(opts ...Option) *Discovery

func (*Discovery) AddresseeRecords

func (d *Discovery) AddresseeRecords(addressee boson.Address) (peers []boson.Address, exists bool)

func (*Discovery) BroadcastPeers

func (d *Discovery) BroadcastPeers(ctx context.Context, addressee boson.Address, peers ...boson.Address) error

func (*Discovery) Broadcasts

func (d *Discovery) Broadcasts() int

func (*Discovery) DoFindNode

func (d *Discovery) DoFindNode(ctx context.Context, target, peer boson.Address, pos []int32, limit int32) (res chan boson.Address, err error)

func (*Discovery) IsHive2

func (d *Discovery) IsHive2() bool

func (*Discovery) IsStart

func (d *Discovery) IsStart() bool

func (*Discovery) NotifyDiscoverWork

func (d *Discovery) NotifyDiscoverWork(peers ...boson.Address)

func (*Discovery) Reset

func (d *Discovery) Reset()

func (*Discovery) SetHive2

func (d *Discovery) SetHive2(is bool)

type Option

type Option interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL