mocks

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockDiscoveryClient

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

func NewDiscoveryClient

func NewDiscoveryClient(h host.Host, server *MockDiscoveryServer) *MockDiscoveryClient

func (*MockDiscoveryClient) Advertise

func (d *MockDiscoveryClient) Advertise(ctx context.Context, ns string, opts ...discovery.Option) (time.Duration, error)

func (*MockDiscoveryClient) FindPeers

func (d *MockDiscoveryClient) FindPeers(ctx context.Context, ns string, opts ...discovery.Option) (<-chan peer.AddrInfo, error)

type MockDiscoveryServer

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

func NewDiscoveryServer

func NewDiscoveryServer(clock clock) *MockDiscoveryServer

func (*MockDiscoveryServer) Advertise

func (s *MockDiscoveryServer) Advertise(ns string, info peer.AddrInfo, ttl time.Duration) (time.Duration, error)

func (*MockDiscoveryServer) FindPeers

func (s *MockDiscoveryServer) FindPeers(ns string, limit int) (<-chan peer.AddrInfo, error)

Jump to

Keyboard shortcuts

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