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.
Click to show internal directories.
Click to hide internal directories.