storj/protos/overlay/overlay.pb.go
Dennis Coyle 9e40141cbc
Coyle/kad client (#91)
* port changes

* Merge remote-tracking branch 'upstream/master'

* Merge remote-tracking branch 'upstream/master'

* Restructure + additional interface

* Add NewOverlayClient

* added test for interface

* PR comments addressed

* lint issue

* added generated protobuf

* fixed merge conflicts

* adding comments

* PR comments addressed
2018-06-19 10:00:15 -04:00

401 lines
14 KiB
Go

// Code generated by protoc-gen-go. DO NOT EDIT.
// source: overlay.proto
/*
Package overlay is a generated protocol buffer package.
It is generated from these files:
overlay.proto
It has these top-level messages:
LookupRequest
LookupResponse
FindStorageNodesResponse
FindStorageNodesRequest
NodeAddress
OverlayOptions
NodeRep
Node
*/
package overlay
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import google_protobuf "github.com/golang/protobuf/ptypes/duration"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
// NodeTransport is an enum of possible transports for the overlay network
type NodeTransport int32
const (
NodeTransport_TCP NodeTransport = 0
)
var NodeTransport_name = map[int32]string{
0: "TCP",
}
var NodeTransport_value = map[string]int32{
"TCP": 0,
}
func (x NodeTransport) String() string {
return proto.EnumName(NodeTransport_name, int32(x))
}
func (NodeTransport) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
// LookupRequest is is request message for the lookup rpc call
type LookupRequest struct {
NodeID string `protobuf:"bytes,1,opt,name=nodeID" json:"nodeID,omitempty"`
}
func (m *LookupRequest) Reset() { *m = LookupRequest{} }
func (m *LookupRequest) String() string { return proto.CompactTextString(m) }
func (*LookupRequest) ProtoMessage() {}
func (*LookupRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *LookupRequest) GetNodeID() string {
if m != nil {
return m.NodeID
}
return ""
}
// LookupResponse is is response message for the lookup rpc call
type LookupResponse struct {
Node *Node `protobuf:"bytes,1,opt,name=node" json:"node,omitempty"`
}
func (m *LookupResponse) Reset() { *m = LookupResponse{} }
func (m *LookupResponse) String() string { return proto.CompactTextString(m) }
func (*LookupResponse) ProtoMessage() {}
func (*LookupResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *LookupResponse) GetNode() *Node {
if m != nil {
return m.Node
}
return nil
}
// FindStorageNodesResponse is is response message for the FindStorageNodes rpc call
type FindStorageNodesResponse struct {
Nodes []*Node `protobuf:"bytes,1,rep,name=nodes" json:"nodes,omitempty"`
}
func (m *FindStorageNodesResponse) Reset() { *m = FindStorageNodesResponse{} }
func (m *FindStorageNodesResponse) String() string { return proto.CompactTextString(m) }
func (*FindStorageNodesResponse) ProtoMessage() {}
func (*FindStorageNodesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
func (m *FindStorageNodesResponse) GetNodes() []*Node {
if m != nil {
return m.Nodes
}
return nil
}
// FindStorageNodesRequest is is request message for the FindStorageNodes rpc call
type FindStorageNodesRequest struct {
ObjectSize int64 `protobuf:"varint,1,opt,name=objectSize" json:"objectSize,omitempty"`
ContractLength *google_protobuf.Duration `protobuf:"bytes,2,opt,name=contractLength" json:"contractLength,omitempty"`
Opts *OverlayOptions `protobuf:"bytes,3,opt,name=opts" json:"opts,omitempty"`
}
func (m *FindStorageNodesRequest) Reset() { *m = FindStorageNodesRequest{} }
func (m *FindStorageNodesRequest) String() string { return proto.CompactTextString(m) }
func (*FindStorageNodesRequest) ProtoMessage() {}
func (*FindStorageNodesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
func (m *FindStorageNodesRequest) GetObjectSize() int64 {
if m != nil {
return m.ObjectSize
}
return 0
}
func (m *FindStorageNodesRequest) GetContractLength() *google_protobuf.Duration {
if m != nil {
return m.ContractLength
}
return nil
}
func (m *FindStorageNodesRequest) GetOpts() *OverlayOptions {
if m != nil {
return m.Opts
}
return nil
}
// NodeAddress contains the information needed to communicate with a node on the network
type NodeAddress struct {
Transport NodeTransport `protobuf:"varint,1,opt,name=transport,enum=NodeTransport" json:"transport,omitempty"`
Address string `protobuf:"bytes,2,opt,name=address" json:"address,omitempty"`
}
func (m *NodeAddress) Reset() { *m = NodeAddress{} }
func (m *NodeAddress) String() string { return proto.CompactTextString(m) }
func (*NodeAddress) ProtoMessage() {}
func (*NodeAddress) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
func (m *NodeAddress) GetTransport() NodeTransport {
if m != nil {
return m.Transport
}
return NodeTransport_TCP
}
func (m *NodeAddress) GetAddress() string {
if m != nil {
return m.Address
}
return ""
}
// OverlayOptions is a set of criteria that a node must meet to be considered for a storage opportunity
type OverlayOptions struct {
MaxLatency *google_protobuf.Duration `protobuf:"bytes,1,opt,name=maxLatency" json:"maxLatency,omitempty"`
MinReputation *NodeRep `protobuf:"bytes,2,opt,name=minReputation" json:"minReputation,omitempty"`
MinSpeedKbps int64 `protobuf:"varint,3,opt,name=minSpeedKbps" json:"minSpeedKbps,omitempty"`
Limit int64 `protobuf:"varint,4,opt,name=limit" json:"limit,omitempty"`
}
func (m *OverlayOptions) Reset() { *m = OverlayOptions{} }
func (m *OverlayOptions) String() string { return proto.CompactTextString(m) }
func (*OverlayOptions) ProtoMessage() {}
func (*OverlayOptions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
func (m *OverlayOptions) GetMaxLatency() *google_protobuf.Duration {
if m != nil {
return m.MaxLatency
}
return nil
}
func (m *OverlayOptions) GetMinReputation() *NodeRep {
if m != nil {
return m.MinReputation
}
return nil
}
func (m *OverlayOptions) GetMinSpeedKbps() int64 {
if m != nil {
return m.MinSpeedKbps
}
return 0
}
func (m *OverlayOptions) GetLimit() int64 {
if m != nil {
return m.Limit
}
return 0
}
// NodeRep is the reputation characteristics of a node
type NodeRep struct {
}
func (m *NodeRep) Reset() { *m = NodeRep{} }
func (m *NodeRep) String() string { return proto.CompactTextString(m) }
func (*NodeRep) ProtoMessage() {}
func (*NodeRep) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
// Node represents a node in the overlay network
type Node struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
Address *NodeAddress `protobuf:"bytes,2,opt,name=address" json:"address,omitempty"`
}
func (m *Node) Reset() { *m = Node{} }
func (m *Node) String() string { return proto.CompactTextString(m) }
func (*Node) ProtoMessage() {}
func (*Node) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
func (m *Node) GetId() string {
if m != nil {
return m.Id
}
return ""
}
func (m *Node) GetAddress() *NodeAddress {
if m != nil {
return m.Address
}
return nil
}
func init() {
proto.RegisterType((*LookupRequest)(nil), "LookupRequest")
proto.RegisterType((*LookupResponse)(nil), "LookupResponse")
proto.RegisterType((*FindStorageNodesResponse)(nil), "FindStorageNodesResponse")
proto.RegisterType((*FindStorageNodesRequest)(nil), "FindStorageNodesRequest")
proto.RegisterType((*NodeAddress)(nil), "NodeAddress")
proto.RegisterType((*OverlayOptions)(nil), "OverlayOptions")
proto.RegisterType((*NodeRep)(nil), "NodeRep")
proto.RegisterType((*Node)(nil), "Node")
proto.RegisterEnum("NodeTransport", NodeTransport_name, NodeTransport_value)
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// Client API for Overlay service
type OverlayClient interface {
// Lookup finds a nodes address from the network
Lookup(ctx context.Context, in *LookupRequest, opts ...grpc.CallOption) (*LookupResponse, error)
// FindStorageNodes finds a list of nodes in the network that meet the specified request parameters
FindStorageNodes(ctx context.Context, in *FindStorageNodesRequest, opts ...grpc.CallOption) (*FindStorageNodesResponse, error)
}
type overlayClient struct {
cc *grpc.ClientConn
}
func NewOverlayClient(cc *grpc.ClientConn) OverlayClient {
return &overlayClient{cc}
}
func (c *overlayClient) Lookup(ctx context.Context, in *LookupRequest, opts ...grpc.CallOption) (*LookupResponse, error) {
out := new(LookupResponse)
err := grpc.Invoke(ctx, "/Overlay/Lookup", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *overlayClient) FindStorageNodes(ctx context.Context, in *FindStorageNodesRequest, opts ...grpc.CallOption) (*FindStorageNodesResponse, error) {
out := new(FindStorageNodesResponse)
err := grpc.Invoke(ctx, "/Overlay/FindStorageNodes", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Overlay service
type OverlayServer interface {
// Lookup finds a nodes address from the network
Lookup(context.Context, *LookupRequest) (*LookupResponse, error)
// FindStorageNodes finds a list of nodes in the network that meet the specified request parameters
FindStorageNodes(context.Context, *FindStorageNodesRequest) (*FindStorageNodesResponse, error)
}
func RegisterOverlayServer(s *grpc.Server, srv OverlayServer) {
s.RegisterService(&_Overlay_serviceDesc, srv)
}
func _Overlay_Lookup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LookupRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OverlayServer).Lookup(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/Overlay/Lookup",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OverlayServer).Lookup(ctx, req.(*LookupRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Overlay_FindStorageNodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FindStorageNodesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OverlayServer).FindStorageNodes(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/Overlay/FindStorageNodes",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OverlayServer).FindStorageNodes(ctx, req.(*FindStorageNodesRequest))
}
return interceptor(ctx, in, info, handler)
}
var _Overlay_serviceDesc = grpc.ServiceDesc{
ServiceName: "Overlay",
HandlerType: (*OverlayServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Lookup",
Handler: _Overlay_Lookup_Handler,
},
{
MethodName: "FindStorageNodes",
Handler: _Overlay_FindStorageNodes_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "overlay.proto",
}
func init() { proto.RegisterFile("overlay.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 450 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xdf, 0x8a, 0x13, 0x31,
0x14, 0xc6, 0x9d, 0x4e, 0xff, 0xd8, 0xd3, 0xed, 0xec, 0x12, 0x44, 0xd3, 0x0a, 0xb2, 0x44, 0xf0,
0x3f, 0xb9, 0xa8, 0x17, 0xe2, 0x8d, 0xb0, 0xb8, 0x28, 0x62, 0x71, 0x25, 0x5d, 0x1f, 0x60, 0xda,
0xc4, 0x1a, 0x6d, 0x73, 0xe2, 0x24, 0x23, 0xae, 0xe0, 0xc3, 0xf8, 0x10, 0xbe, 0x9f, 0x4c, 0x32,
0xdd, 0xed, 0x54, 0xba, 0x77, 0x73, 0xce, 0xf9, 0xbe, 0xc9, 0x39, 0x3f, 0x3e, 0x18, 0xe2, 0x0f,
0x55, 0xac, 0xf2, 0x0b, 0x6e, 0x0b, 0xf4, 0x38, 0xce, 0x64, 0x59, 0xe4, 0x5e, 0xa3, 0x89, 0x35,
0x7b, 0x08, 0xc3, 0x29, 0xe2, 0xb7, 0xd2, 0x0a, 0xf5, 0xbd, 0x54, 0xce, 0x93, 0xdb, 0xd0, 0x35,
0x28, 0xd5, 0xbb, 0x53, 0x9a, 0x1c, 0x27, 0x8f, 0xfa, 0xa2, 0xae, 0xd8, 0x53, 0xc8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