routing

package
Version: v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

package routing defines the interface for a routing system used by ipfs.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("routing: not found")

ErrNotFound is returned when a search fails to find anything

Functions

This section is empty.

Types

type IpfsRouting

type IpfsRouting interface {
	FindProvidersAsync(context.Context, u.Key, int) <-chan peer.PeerInfo

	// PutValue adds value corresponding to given Key.
	PutValue(context.Context, u.Key, []byte) error

	// GetValue searches for the value corresponding to given Key.
	GetValue(context.Context, u.Key) ([]byte, error)

	// Announce that this node can provide value for given key
	Provide(context.Context, u.Key) error

	// Find specific Peer
	// FindPeer searches for a peer with given ID, returns a peer.PeerInfo
	// with relevant addresses.
	FindPeer(context.Context, peer.ID) (peer.PeerInfo, error)

	// Ping a peer, log the time it took
	Ping(context.Context, peer.ID) (time.Duration, error)

	// Bootstrap allows callers to hint to the routing system to get into a
	// Boostrapped state
	Bootstrap(context.Context) error
}

IpfsRouting is the routing module interface It is implemented by things like DHTs, etc.

Source Files

Directories

Path Synopsis
dht
Package dht implements a distributed hash table that satisfies the ipfs routing interface.
Package dht implements a distributed hash table that satisfies the ipfs routing interface.
pb
Package dht_pb is a generated protocol buffer package.
Package dht_pb is a generated protocol buffer package.
package kbucket implements a kademlia 'k-bucket' routing table.
package kbucket implements a kademlia 'k-bucket' routing table.
Package mock provides a virtual routing server.
Package mock provides a virtual routing server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL