2014-07-28 22:14:27 -07:00
|
|
|
// Code generated by protoc-gen-go.
|
|
|
|
// source: messages.proto
|
|
|
|
// DO NOT EDIT!
|
|
|
|
|
|
|
|
/*
|
|
|
|
Package dht is a generated protocol buffer package.
|
|
|
|
|
|
|
|
It is generated from these files:
|
|
|
|
messages.proto
|
|
|
|
|
|
|
|
It has these top-level messages:
|
2014-08-08 18:09:21 -07:00
|
|
|
PBDHTMessage
|
2014-07-28 22:14:27 -07:00
|
|
|
*/
|
|
|
|
package dht
|
|
|
|
|
|
|
|
import proto "code.google.com/p/goprotobuf/proto"
|
|
|
|
import math "math"
|
|
|
|
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
|
|
var _ = proto.Marshal
|
|
|
|
var _ = math.Inf
|
|
|
|
|
2014-08-08 18:09:21 -07:00
|
|
|
type PBDHTMessage_MessageType int32
|
2014-07-28 22:14:27 -07:00
|
|
|
|
|
|
|
const (
|
2014-08-08 18:09:21 -07:00
|
|
|
PBDHTMessage_PUT_VALUE PBDHTMessage_MessageType = 0
|
|
|
|
PBDHTMessage_GET_VALUE PBDHTMessage_MessageType = 1
|
|
|
|
PBDHTMessage_ADD_PROVIDER PBDHTMessage_MessageType = 2
|
|
|
|
PBDHTMessage_GET_PROVIDERS PBDHTMessage_MessageType = 3
|
|
|
|
PBDHTMessage_FIND_NODE PBDHTMessage_MessageType = 4
|
|
|
|
PBDHTMessage_PING PBDHTMessage_MessageType = 5
|
|
|
|
PBDHTMessage_DIAGNOSTIC PBDHTMessage_MessageType = 6
|
2014-07-28 22:14:27 -07:00
|
|
|
)
|
|
|
|
|
2014-08-08 18:09:21 -07:00
|
|
|
var PBDHTMessage_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-08-06 10:02:53 -07:00
|
|
|
6: "DIAGNOSTIC",
|
2014-07-28 22:14:27 -07:00
|
|
|
}
|
2014-08-08 18:09:21 -07:00
|
|
|
var PBDHTMessage_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-08-06 10:02:53 -07:00
|
|
|
"DIAGNOSTIC": 6,
|
2014-07-28 22:14:27 -07:00
|
|
|
}
|
|
|
|
|
2014-08-08 18:09:21 -07:00
|
|
|
func (x PBDHTMessage_MessageType) Enum() *PBDHTMessage_MessageType {
|
|
|
|
p := new(PBDHTMessage_MessageType)
|
2014-07-28 22:14:27 -07:00
|
|
|
*p = x
|
|
|
|
return p
|
|
|
|
}
|
2014-08-08 18:09:21 -07:00
|
|
|
func (x PBDHTMessage_MessageType) String() string {
|
|
|
|
return proto.EnumName(PBDHTMessage_MessageType_name, int32(x))
|
2014-07-28 22:14:27 -07:00
|
|
|
}
|
2014-08-08 18:09:21 -07:00
|
|
|
func (x *PBDHTMessage_MessageType) UnmarshalJSON(data []byte) error {
|
|
|
|
value, err := proto.UnmarshalJSONEnum(PBDHTMessage_MessageType_value, data, "PBDHTMessage_MessageType")
|
2014-07-28 22:14:27 -07:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2014-08-08 18:09:21 -07:00
|
|
|
*x = PBDHTMessage_MessageType(value)
|
2014-07-28 22:14:27 -07:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2014-08-08 18:09:21 -07:00
|
|
|
type PBDHTMessage struct {
|
|
|
|
Type *PBDHTMessage_MessageType `protobuf:"varint,1,req,name=type,enum=dht.PBDHTMessage_MessageType" json:"type,omitempty"`
|
|
|
|
Key *string `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"`
|
|
|
|
Value []byte `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"`
|
|
|
|
Id *uint64 `protobuf:"varint,4,req,name=id" json:"id,omitempty"`
|
|
|
|
Response *bool `protobuf:"varint,5,opt,name=response" json:"response,omitempty"`
|
|
|
|
Success *bool `protobuf:"varint,6,opt,name=success" json:"success,omitempty"`
|
|
|
|
Peers []*PBDHTMessage_PBPeer `protobuf:"bytes,7,rep,name=peers" json:"peers,omitempty"`
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
2014-07-28 22:14:27 -07:00
|
|
|
}
|
|
|
|
|
2014-08-08 18:09:21 -07:00
|
|
|
func (m *PBDHTMessage) Reset() { *m = PBDHTMessage{} }
|
|
|
|
func (m *PBDHTMessage) String() string { return proto.CompactTextString(m) }
|
|
|
|
func (*PBDHTMessage) ProtoMessage() {}
|
2014-07-28 22:14:27 -07:00
|
|
|
|
2014-08-08 18:09:21 -07:00
|
|
|
func (m *PBDHTMessage) GetType() PBDHTMessage_MessageType {
|
2014-07-28 22:14:27 -07:00
|
|
|
if m != nil && m.Type != nil {
|
|
|
|
return *m.Type
|
|
|
|
}
|
2014-08-08 18:09:21 -07:00
|
|
|
return PBDHTMessage_PUT_VALUE
|
2014-07-28 22:14:27 -07:00
|
|
|
}
|
|
|
|
|
2014-08-08 18:09:21 -07:00
|
|
|
func (m *PBDHTMessage) GetKey() string {
|
2014-07-28 22:14:27 -07:00
|
|
|
if m != nil && m.Key != nil {
|
|
|
|
return *m.Key
|
|
|
|
}
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2014-08-08 18:09:21 -07:00
|
|
|
func (m *PBDHTMessage) GetValue() []byte {
|
2014-07-28 22:14:27 -07:00
|
|
|
if m != nil {
|
|
|
|
return m.Value
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2014-08-08 18:09:21 -07:00
|
|
|
func (m *PBDHTMessage) GetId() uint64 {
|
2014-07-29 19:33:51 -07:00
|
|
|
if m != nil && m.Id != nil {
|
|
|
|
return *m.Id
|
|
|
|
}
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2014-08-08 18:09:21 -07:00
|
|
|
func (m *PBDHTMessage) GetResponse() bool {
|
2014-07-30 17:46:56 -07:00
|
|
|
if m != nil && m.Response != nil {
|
|
|
|
return *m.Response
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2014-08-08 18:09:21 -07:00
|
|
|
func (m *PBDHTMessage) GetSuccess() bool {
|
2014-08-06 18:37:45 -07:00
|
|
|
if m != nil && m.Success != nil {
|
|
|
|
return *m.Success
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2014-08-08 18:09:21 -07:00
|
|
|
func (m *PBDHTMessage) GetPeers() []*PBDHTMessage_PBPeer {
|
|
|
|
if m != nil {
|
|
|
|
return m.Peers
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type PBDHTMessage_PBPeer struct {
|
|
|
|
Id *string `protobuf:"bytes,1,req,name=id" json:"id,omitempty"`
|
|
|
|
Addr *string `protobuf:"bytes,2,req,name=addr" json:"addr,omitempty"`
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *PBDHTMessage_PBPeer) Reset() { *m = PBDHTMessage_PBPeer{} }
|
|
|
|
func (m *PBDHTMessage_PBPeer) String() string { return proto.CompactTextString(m) }
|
|
|
|
func (*PBDHTMessage_PBPeer) ProtoMessage() {}
|
|
|
|
|
|
|
|
func (m *PBDHTMessage_PBPeer) GetId() string {
|
|
|
|
if m != nil && m.Id != nil {
|
|
|
|
return *m.Id
|
|
|
|
}
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *PBDHTMessage_PBPeer) GetAddr() string {
|
|
|
|
if m != nil && m.Addr != nil {
|
|
|
|
return *m.Addr
|
|
|
|
}
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2014-07-28 22:14:27 -07:00
|
|
|
func init() {
|
2014-08-08 18:09:21 -07:00
|
|
|
proto.RegisterEnum("dht.PBDHTMessage_MessageType", PBDHTMessage_MessageType_name, PBDHTMessage_MessageType_value)
|
2014-07-28 22:14:27 -07:00
|
|
|
}
|