local

package
v1.3.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: MIT Imports: 13 Imported by: 3 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package local provides a local, non-networked implementation of the interfaces defined by the net package. It should largely be considered a sample implementation, and is not meant to be used at scale in any way.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider interface {
	net.Provider

	// AddPeer allows the simulation of adding a peer to the client's local
	// registry of peers.
	AddPeer(peerID string, pubKey *key.NetworkPublic)
}

Provider is an extension of net.Provider. This interface exposes additional functions useful for testing.

func Connect

func Connect() Provider

Connect returns a local instance of a net provider that does not go over the network.

func ConnectWithKey

func ConnectWithKey(staticKey *key.NetworkPublic) Provider

ConnectWithKey returns a local instance of net provider that does not go over the network. The returned instance uses the provided network key to identify network messages.

Jump to

Keyboard shortcuts

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