storj/pkg/node/client.go
Dennis Coyle ea077e4dcb
node-node communication (#145)
* node-node communication

* PR reviews comments from @bryanchriswhite addressed
2018-07-19 10:48:08 -04:00

28 lines
585 B
Go

// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information
package node
import (
"context"
"storj.io/storj/pkg/pool"
"storj.io/storj/pkg/transport"
proto "storj.io/storj/protos/overlay"
)
// NewNodeClient instantiates a node client
func NewNodeClient(self proto.Node) (Client, error) {
return &Node{
self: self,
tc: transport.NewClient(),
cache: pool.NewConnectionPool(),
}, nil
}
// Client is the Node client communication interface
type Client interface {
Lookup(ctx context.Context, to proto.Node, find proto.Node) ([]*proto.Node, error)
}