local

package
v1.2.0-rc Latest Latest
Warning

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

Go to latest
Published: May 7, 2020 License: MIT Imports: 13 Imported by: 1

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