2014-10-25 04:13:28 -07:00
|
|
|
// Code generated by protoc-gen-gogo.
|
|
|
|
// source: dht.proto
|
2014-07-28 22:14:27 -07:00
|
|
|
// DO NOT EDIT!
|
|
|
|
|
|
|
|
/*
|
2014-10-25 04:13:28 -07:00
|
|
|
Package dht_pb is a generated protocol buffer package.
|
2014-07-28 22:14:27 -07:00
|
|
|
|
|
|
|
It is generated from these files:
|
2014-10-25 04:13:28 -07:00
|
|
|
dht.proto
|
2014-07-28 22:14:27 -07:00
|
|
|
|
|
|
|
It has these top-level messages:
|
2014-09-16 00:52:57 -07:00
|
|
|
Message
|
2014-07-28 22:14:27 -07:00
|
|
|
*/
|
2014-10-25 04:13:28 -07:00
|
|
|
package dht_pb
|
2014-07-28 22:14:27 -07:00
|
|
|
|
2016-08-21 17:18:58 +01:00
|
|
|
import proto "github.com/gogo/protobuf/proto"
|
2016-09-02 20:21:23 +01:00
|
|
|
import fmt "fmt"
|
2014-07-28 22:14:27 -07:00
|
|
|
import math "math"
|
|
|
|
|
2015-04-28 12:33:02 +02:00
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
2014-07-28 22:14:27 -07:00
|
|
|
var _ = proto.Marshal
|
2016-09-02 20:21:23 +01:00
|
|
|
var _ = fmt.Errorf
|
2014-07-28 22:14:27 -07:00
|
|
|
var _ = math.Inf
|
|
|
|
|
2016-09-02 20:21:23 +01:00
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
|
|
// is compatible with the proto package it is being compiled against.
|
|
|
|
const _ = proto.GoGoProtoPackageIsVersion1
|
|
|
|
|
2014-09-16 00:52:57 -07:00
|
|
|
type Message_MessageType int32
|
2014-07-28 22:14:27 -07:00
|
|
|
|
|
|
|
const (
|
2014-09-16 00:52:57 -07:00
|
|
|
Message_PUT_VALUE Message_MessageType = 0
|
|
|
|
Message_GET_VALUE Message_MessageType = 1
|
|
|
|
Message_ADD_PROVIDER Message_MessageType = 2
|
|
|
|
Message_GET_PROVIDERS Message_MessageType = 3
|
|
|
|
Message_FIND_NODE Message_MessageType = 4
|
|
|
|
Message_PING Message_MessageType = 5
|
2014-07-28 22:14:27 -07:00
|
|
|
)
|
|
|
|
|
2014-09-16 00:52:57 -07:00
|
|
|
var Message_MessageType_name = map[int32]string{
|
2014-07-28 22:14:27 -07:00
|
|
|
0: "PUT_VALUE",
|
|
|
|
1: "GET_VALUE",
|
2014-07-29 19:33:51 -07:00
|
|
|
2: "ADD_PROVIDER",
|
|
|
|
3: "GET_PROVIDERS",
|
|
|
|
4: "FIND_NODE",
|
|
|
|
5: "PING",
|
2014-07-28 22:14:27 -07:00
|
|
|
}
|
2014-09-16 00:52:57 -07:00
|
|
|
var Message_MessageType_value = map[string]int32{
|
2014-07-29 19:33:51 -07:00
|
|
|
"PUT_VALUE": 0,
|
|
|
|
"GET_VALUE": 1,
|
|
|
|
"ADD_PROVIDER": 2,
|
|
|
|
"GET_PROVIDERS": 3,
|
|
|
|
"FIND_NODE": 4,
|
|
|
|
"PING": 5,
|
2014-07-28 22:14:27 -07:00
|
|
|
}
|
|
|
|
|
2014-09-16 00:52:57 -07:00
|
|
|
func (x Message_MessageType) Enum() *Message_MessageType {
|
|
|
|
p := new(Message_MessageType)
|
2014-07-28 22:14:27 -07:00
|
|
|
*p = x
|
|
|
|
return p
|
|
|
|
}
|
2014-09-16 00:52:57 -07:00
|
|
|
func (x Message_MessageType) String() string {
|
|
|
|
return proto.EnumName(Message_MessageType_name, int32(x))
|
2014-07-28 22:14:27 -07:00
|
|
|
}
|
2014-09-16 00:52:57 -07:00
|
|
|
func (x *Message_MessageType) UnmarshalJSON(data []byte) error {
|
|
|
|
value, err := proto.UnmarshalJSONEnum(Message_MessageType_value, data, "Message_MessageType")
|
2014-07-28 22:14:27 -07:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2014-09-16 00:52:57 -07:00
|
|
|
*x = Message_MessageType(value)
|
2014-07-28 22:14:27 -07:00
|
|
|
return nil
|
|
|
|
}
|
2016-09-02 20:21:23 +01:00
|
|
|
func (Message_MessageType) EnumDescriptor() ([]byte, []int) { return fileDescriptorDht, []int{0, 0} }
|
2014-07-28 22:14:27 -07:00
|
|
|
|
2014-11-20 10:46:56 -08:00
|
|
|
type Message_ConnectionType int32
|
|
|
|
|
|
|
|
const (
|
|
|
|
// sender does not have a connection to peer, and no extra information (default)
|
|
|
|
Message_NOT_CONNECTED Message_ConnectionType = 0
|
|
|
|
// sender has a live connection to peer
|
|
|
|
Message_CONNECTED Message_ConnectionType = 1
|
|
|
|
// sender recently connected to peer
|
|
|
|
Message_CAN_CONNECT Message_ConnectionType = 2
|
|
|
|
// sender recently tried to connect to peer repeatedly but failed to connect
|
|
|
|
// ("try" here is loose, but this should signal "made strong effort, failed")
|
|
|
|
Message_CANNOT_CONNECT Message_ConnectionType = 3
|
|
|
|
)
|
|
|
|
|
|
|
|
var Message_ConnectionType_name = map[int32]string{
|
|
|
|
0: "NOT_CONNECTED",
|
|
|
|
1: "CONNECTED",
|
|
|
|
2: "CAN_CONNECT",
|
|
|
|
3: "CANNOT_CONNECT",
|
|
|
|
}
|
|
|
|
var Message_ConnectionType_value = map[string]int32{
|
|
|
|
"NOT_CONNECTED": 0,
|
|
|
|
"CONNECTED": 1,
|
|
|
|
"CAN_CONNECT": 2,
|
|
|
|
"CANNOT_CONNECT": 3,
|
|
|
|
}
|
|
|
|
|
|
|
|
func (x Message_ConnectionType) Enum() *Message_ConnectionType {
|
|
|
|
p := new(Message_ConnectionType)
|
|
|
|
*p = x
|
|
|
|
return p
|
|
|
|
}
|
|
|
|
func (x Message_ConnectionType) String() string {
|
|
|
|
return proto.EnumName(Message_ConnectionType_name, int32(x))
|
|
|
|
}
|
|
|
|
func (x *Message_ConnectionType) UnmarshalJSON(data []byte) error {
|
|
|
|
value, err := proto.UnmarshalJSONEnum(Message_ConnectionType_value, data, "Message_ConnectionType")
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
*x = Message_ConnectionType(value)
|
|
|
|
return nil
|
|
|
|
}
|
2016-09-02 20:21:23 +01:00
|
|
|
func (Message_ConnectionType) EnumDescriptor() ([]byte, []int) { return fileDescriptorDht, []int{0, 1} }
|
2014-11-20 10:46:56 -08:00
|
|
|
|
2014-09-16 00:52:57 -07:00
|
|
|
type Message struct {
|
|
|
|
// defines what type of message it is.
|
2014-10-25 04:13:28 -07:00
|
|
|
Type *Message_MessageType `protobuf:"varint,1,opt,name=type,enum=dht.pb.Message_MessageType" json:"type,omitempty"`
|
2014-09-16 00:52:57 -07:00
|
|
|
// defines what coral cluster level this query/response belongs to.
|
|
|
|
ClusterLevelRaw *int32 `protobuf:"varint,10,opt,name=clusterLevelRaw" json:"clusterLevelRaw,omitempty"`
|
|
|
|
// Used to specify the key associated with this message.
|
|
|
|
// PUT_VALUE, GET_VALUE, ADD_PROVIDER, GET_PROVIDERS
|
|
|
|
Key *string `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"`
|
|
|
|
// Used to return a value
|
|
|
|
// PUT_VALUE, GET_VALUE
|
2016-09-02 20:21:23 +01:00
|
|
|
Record *record_pb.Record `protobuf:"bytes,3,opt,name=record" json:"record,omitempty"`
|
2014-09-16 00:52:57 -07:00
|
|
|
// Used to return peers closer to a key in a query
|
|
|
|
// GET_VALUE, GET_PROVIDERS, FIND_NODE
|
|
|
|
CloserPeers []*Message_Peer `protobuf:"bytes,8,rep,name=closerPeers" json:"closerPeers,omitempty"`
|
|
|
|
// Used to return Providers
|
|
|
|
// GET_VALUE, ADD_PROVIDER, GET_PROVIDERS
|
|
|
|
ProviderPeers []*Message_Peer `protobuf:"bytes,9,rep,name=providerPeers" json:"providerPeers,omitempty"`
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
}
|
|
|
|
|
2016-09-02 20:21:23 +01:00
|
|
|
func (m *Message) Reset() { *m = Message{} }
|
|
|
|
func (m *Message) String() string { return proto.CompactTextString(m) }
|
|
|
|
func (*Message) ProtoMessage() {}
|
|
|
|
func (*Message) Descriptor() ([]byte, []int) { return fileDescriptorDht, []int{0} }
|
2014-09-16 00:52:57 -07:00
|
|
|
|
|
|
|
func (m *Message) GetType() Message_MessageType {
|
2014-07-28 22:14:27 -07:00
|
|
|
if m != nil && m.Type != nil {
|
|
|
|
return *m.Type
|
|
|
|
}
|
2014-09-16 00:52:57 -07:00
|
|
|
return Message_PUT_VALUE
|
2014-07-28 22:14:27 -07:00
|
|
|
}
|
|
|
|
|
2014-09-16 00:52:57 -07:00
|
|
|
func (m *Message) GetClusterLevelRaw() int32 {
|
|
|
|
if m != nil && m.ClusterLevelRaw != nil {
|
|
|
|
return *m.ClusterLevelRaw
|
|
|
|
}
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Message) GetKey() string {
|
2014-07-28 22:14:27 -07:00
|
|
|
if m != nil && m.Key != nil {
|
|
|
|
return *m.Key
|
|
|
|
}
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2016-09-02 20:21:23 +01:00
|
|
|
func (m *Message) GetRecord() *record_pb.Record {
|
2014-07-28 22:14:27 -07:00
|
|
|
if m != nil {
|
2014-11-09 23:45:16 -08:00
|
|
|
return m.Record
|
2014-07-28 22:14:27 -07:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2014-09-16 00:52:57 -07:00
|
|
|
func (m *Message) GetCloserPeers() []*Message_Peer {
|
|
|
|
if m != nil {
|
|
|
|
return m.CloserPeers
|
2014-08-06 18:37:45 -07:00
|
|
|
}
|
2014-09-16 00:52:57 -07:00
|
|
|
return nil
|
2014-08-06 18:37:45 -07:00
|
|
|
}
|
|
|
|
|
2014-09-16 00:52:57 -07:00
|
|
|
func (m *Message) GetProviderPeers() []*Message_Peer {
|
2014-08-08 18:09:21 -07:00
|
|
|
if m != nil {
|
2014-09-16 00:52:57 -07:00
|
|
|
return m.ProviderPeers
|
2014-08-08 18:09:21 -07:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2014-09-16 00:52:57 -07:00
|
|
|
type Message_Peer struct {
|
2014-11-20 10:46:56 -08:00
|
|
|
// ID of a given peer.
|
|
|
|
Id *string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
|
|
|
|
// multiaddrs for a given peer
|
2014-12-19 12:19:56 -08:00
|
|
|
Addrs [][]byte `protobuf:"bytes,2,rep,name=addrs" json:"addrs,omitempty"`
|
2014-11-20 10:46:56 -08:00
|
|
|
// used to signal the sender's connection capabilities to the peer
|
|
|
|
Connection *Message_ConnectionType `protobuf:"varint,3,opt,name=connection,enum=dht.pb.Message_ConnectionType" json:"connection,omitempty"`
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
2014-08-08 18:09:21 -07:00
|
|
|
}
|
|
|
|
|
2016-09-02 20:21:23 +01:00
|
|
|
func (m *Message_Peer) Reset() { *m = Message_Peer{} }
|
|
|
|
func (m *Message_Peer) String() string { return proto.CompactTextString(m) }
|
|
|
|
func (*Message_Peer) ProtoMessage() {}
|
|
|
|
func (*Message_Peer) Descriptor() ([]byte, []int) { return fileDescriptorDht, []int{0, 0} }
|
2014-08-08 18:09:21 -07:00
|
|
|
|
2014-09-16 00:52:57 -07:00
|
|
|
func (m *Message_Peer) GetId() string {
|
2014-08-08 18:09:21 -07:00
|
|
|
if m != nil && m.Id != nil {
|
|
|
|
return *m.Id
|
|
|
|
}
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2014-12-19 12:19:56 -08:00
|
|
|
func (m *Message_Peer) GetAddrs() [][]byte {
|
2014-11-20 10:46:56 -08:00
|
|
|
if m != nil {
|
|
|
|
return m.Addrs
|
2014-08-08 18:09:21 -07:00
|
|
|
}
|
2014-11-20 10:46:56 -08:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Message_Peer) GetConnection() Message_ConnectionType {
|
|
|
|
if m != nil && m.Connection != nil {
|
|
|
|
return *m.Connection
|
|
|
|
}
|
|
|
|
return Message_NOT_CONNECTED
|
2014-08-08 18:09:21 -07:00
|
|
|
}
|
|
|
|
|
2014-07-28 22:14:27 -07:00
|
|
|
func init() {
|
2016-09-02 20:21:23 +01:00
|
|
|
proto.RegisterType((*Message)(nil), "dht.pb.Message")
|
|
|
|
proto.RegisterType((*Message_Peer)(nil), "dht.pb.Message.Peer")
|
2014-10-25 04:13:28 -07:00
|
|
|
proto.RegisterEnum("dht.pb.Message_MessageType", Message_MessageType_name, Message_MessageType_value)
|
2014-11-20 10:46:56 -08:00
|
|
|
proto.RegisterEnum("dht.pb.Message_ConnectionType", Message_ConnectionType_name, Message_ConnectionType_value)
|
2014-07-28 22:14:27 -07:00
|
|
|
}
|
2016-09-02 20:21:23 +01:00
|
|
|
|
|
|
|
var fileDescriptorDht = []byte{
|
|
|
|
// 372 bytes of a gzipped FileDescriptorProto
|
|
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x7c, 0x90, 0x4d, 0x8f, 0x9a, 0x50,
|
|
|
|
0x14, 0x86, 0xcb, 0x87, 0x56, 0x0e, 0x8a, 0x78, 0xe2, 0x82, 0xd8, 0xa4, 0x31, 0xae, 0xec, 0x86,
|
|
|
|
0x26, 0x2e, 0xba, 0xe8, 0xa2, 0x09, 0x01, 0x6a, 0x4c, 0xec, 0xc5, 0xdc, 0xa2, 0x5d, 0x12, 0x85,
|
|
|
|
0x9b, 0x0e, 0x19, 0x22, 0x06, 0x18, 0x27, 0xfe, 0xc2, 0xf9, 0x5b, 0x73, 0x01, 0x99, 0x41, 0x17,
|
|
|
|
0xb3, 0xba, 0xef, 0x39, 0xf7, 0x79, 0xcf, 0x17, 0x28, 0xd1, 0x43, 0x61, 0x9e, 0xb2, 0xb4, 0x48,
|
|
|
|
0xb1, 0x5b, 0xc9, 0xc3, 0xa4, 0x9f, 0xb1, 0x30, 0xcd, 0xa2, 0x3a, 0x3b, 0x7b, 0x91, 0xe1, 0xf3,
|
|
|
|
0x1f, 0x96, 0xe7, 0xfb, 0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