Documentation
¶
Index ¶
- type Client
- func (c *Client) Bootstrap(ctx context.Context) error
- func (c *Client) FindPeer(ctx context.Context, id peer.ID) (pstore.PeerInfo, error)
- func (c *Client) FindProvidersAsync(ctx context.Context, k *cid.Cid, max int) <-chan pstore.PeerInfo
- func (c *Client) GetValue(ctx context.Context, k string) ([]byte, error)
- func (c *Client) GetValues(ctx context.Context, k string, _ int) ([]routing.RecvdVal, error)
- func (c *Client) Ping(ctx context.Context, id peer.ID) (time.Duration, error)
- func (c *Client) Provide(ctx context.Context, k *cid.Cid, brd bool) error
- func (c *Client) PutValue(ctx context.Context, k string, v []byte) error
- type Server
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 pstore.Peerstore, local peer.ID) (*Client, error)
TODO take in datastore/cache
func (*Client) FindPeer ¶
func (c *Client) FindPeer(ctx context.Context, id peer.ID) (pstore.PeerInfo, error)
func (*Client) FindProvidersAsync ¶
func (c *Client) FindProvidersAsync(ctx context.Context, k *cid.Cid, max int) <-chan pstore.PeerInfo
func (*Client) GetValues ¶ added in v0.3.8
func (c *Client) GetValues(ctx context.Context, k string, _ int) ([]routing.RecvdVal, 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 pstore.Peerstore, local peer.ID) (*Server, error)
NewServer creates a new Supernode routing Server
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.
Click to show internal directories.
Click to hide internal directories.