supernode

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2016 License: MIT Imports: 15 Imported by: 0 modules, 0 packages

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(px proxy.Proxy, h host.Host, ps peer.Peerstore, local peer.ID) (*Client, error)

TODO take in datastore/cache

func (*Client) Bootstrap

func (c *Client) Bootstrap(ctx context.Context) error

func (*Client) FindPeer

func (c *Client) FindPeer(ctx context.Context, id peer.ID) (peer.PeerInfo, error)

func (*Client) FindProvidersAsync

func (c *Client) FindProvidersAsync(ctx context.Context, k key.Key, max int) <-chan peer.PeerInfo

func (*Client) GetValue

func (c *Client) GetValue(ctx context.Context, k key.Key) ([]byte, error)

func (*Client) GetValues added in v0.3.8

func (c *Client) GetValues(ctx context.Context, k key.Key, _ int) ([]routing.RecvdVal, error)

func (*Client) Ping

func (c *Client) Ping(ctx context.Context, id peer.ID) (time.Duration, error)

func (*Client) Provide

func (c *Client) Provide(ctx context.Context, k key.Key) error

func (*Client) PutValue

func (c *Client) PutValue(ctx context.Context, k key.Key, v []byte) error

type Server

type Server struct {
	*proxy.Loopback // so server can be injected into client
	// contains filtered or unexported fields
}

Server handles routing queries using a database backend

func NewServer

func NewServer(ds datastore.Datastore, ps peer.Peerstore, local peer.ID) (*Server, error)

NewServer creates a new Supernode routing Server

func (*Server) Bootstrap

func (_ *Server) Bootstrap(ctx context.Context) error

func (*Server) HandleRequest

func (s *Server) HandleRequest(ctx context.Context, p peer.ID, req *dhtpb.Message) *dhtpb.Message

HandleLocalRequest implements the proxy.RequestHandler interface. This is where requests are received from the outside world.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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