messages.pb.go 4.26 KB
Newer Older
1
// Code generated by protoc-gen-gogo.
2 3 4 5 6 7 8 9 10 11
// 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:
12
	Message
13 14 15
*/
package dht

16 17
import proto "code.google.com/p/gogoprotobuf/proto"
import json "encoding/json"
18 19
import math "math"

20
// Reference proto, json, and math imports to suppress error if they are not otherwise used.
21
var _ = proto.Marshal
22
var _ = &json.SyntaxError{}
23 24
var _ = math.Inf

25
type Message_MessageType int32
26 27

const (
28 29 30 31 32 33 34
	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
	Message_DIAGNOSTIC    Message_MessageType = 6
35 36
)

37
var Message_MessageType_name = map[int32]string{
38 39
	0: "PUT_VALUE",
	1: "GET_VALUE",
40 41 42 43
	2: "ADD_PROVIDER",
	3: "GET_PROVIDERS",
	4: "FIND_NODE",
	5: "PING",
Jeromy's avatar
Jeromy committed
44
	6: "DIAGNOSTIC",
45
}
46
var Message_MessageType_value = map[string]int32{
47 48 49 50 51 52
	"PUT_VALUE":     0,
	"GET_VALUE":     1,
	"ADD_PROVIDER":  2,
	"GET_PROVIDERS": 3,
	"FIND_NODE":     4,
	"PING":          5,
Jeromy's avatar
Jeromy committed
53
	"DIAGNOSTIC":    6,
54 55
}

56 57
func (x Message_MessageType) Enum() *Message_MessageType {
	p := new(Message_MessageType)
58 59 60
	*p = x
	return p
}
61 62
func (x Message_MessageType) String() string {
	return proto.EnumName(Message_MessageType_name, int32(x))
63
}
64 65
func (x *Message_MessageType) UnmarshalJSON(data []byte) error {
	value, err := proto.UnmarshalJSONEnum(Message_MessageType_value, data, "Message_MessageType")
66 67 68
	if err != nil {
		return err
	}
69
	*x = Message_MessageType(value)
70 71 72
	return nil
}

73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
type Message struct {
	// defines what type of message it is.
	Type *Message_MessageType `protobuf:"varint,1,req,name=type,enum=dht.Message_MessageType" json:"type,omitempty"`
	// 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
	Value []byte `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"`
	// 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:"-"`
}

func (m *Message) Reset()         { *m = Message{} }
func (m *Message) String() string { return proto.CompactTextString(m) }
func (*Message) ProtoMessage()    {}

func (m *Message) GetType() Message_MessageType {
98 99 100
	if m != nil && m.Type != nil {
		return *m.Type
	}
101
	return Message_PUT_VALUE
102 103
}

104 105 106 107 108 109 110 111
func (m *Message) GetClusterLevelRaw() int32 {
	if m != nil && m.ClusterLevelRaw != nil {
		return *m.ClusterLevelRaw
	}
	return 0
}

func (m *Message) GetKey() string {
112 113 114 115 116 117
	if m != nil && m.Key != nil {
		return *m.Key
	}
	return ""
}

118
func (m *Message) GetValue() []byte {
119 120 121 122 123 124
	if m != nil {
		return m.Value
	}
	return nil
}

125 126 127
func (m *Message) GetCloserPeers() []*Message_Peer {
	if m != nil {
		return m.CloserPeers
128
	}
129
	return nil
130 131
}

132
func (m *Message) GetProviderPeers() []*Message_Peer {
133
	if m != nil {
134
		return m.ProviderPeers
135 136 137 138
	}
	return nil
}

139
type Message_Peer struct {
140 141 142 143 144
	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:"-"`
}

145 146 147
func (m *Message_Peer) Reset()         { *m = Message_Peer{} }
func (m *Message_Peer) String() string { return proto.CompactTextString(m) }
func (*Message_Peer) ProtoMessage()    {}
148

149
func (m *Message_Peer) GetId() string {
150 151 152 153 154 155
	if m != nil && m.Id != nil {
		return *m.Id
	}
	return ""
}

156
func (m *Message_Peer) GetAddr() string {
157 158 159 160 161 162
	if m != nil && m.Addr != nil {
		return *m.Addr
	}
	return ""
}

163
func init() {
164
	proto.RegisterEnum("dht.Message_MessageType", Message_MessageType_name, Message_MessageType_value)
165
}