mockrouting

package
v0.4.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2016 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package mock provides a virtual routing server. To use it, create a virtual routing server and use the Client() method to get a routing client (IpfsRouting). The server quacks like a DHT but is really a local in-memory hash table.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	FindProviders(context.Context, key.Key) ([]peer.PeerInfo, error)
	routing.IpfsRouting
}

Client implements IpfsRouting

type DelayConfig

type DelayConfig struct {
	// ValueVisibility is the time it takes for a value to be visible in the network
	// FIXME there _must_ be a better term for this
	ValueVisibility delay.D

	// Query is the time it takes to receive a response from a routing query
	Query delay.D
}

type Server

type Server interface {
	Client(p testutil.Identity) Client
	ClientWithDatastore(context.Context, testutil.Identity, ds.Datastore) Client
}

Server provides mockrouting Clients

func NewDHTNetwork

func NewDHTNetwork(mn mocknet.Mocknet) Server

func NewServer

func NewServer() Server

NewServer returns a mockrouting Server

func NewServerWithDelay

func NewServerWithDelay(conf DelayConfig) Server

NewServerWithDelay returns a mockrouting Server with a delay!

Jump to

Keyboard shortcuts

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