github.com/keltia/go-ipfs@v0.3.8-0.20150909044612-210793031c63/routing/dht/pb/dht.pb.go (about) 1 // Code generated by protoc-gen-gogo. 2 // source: dht.proto 3 // DO NOT EDIT! 4 5 /* 6 Package dht_pb is a generated protocol buffer package. 7 8 It is generated from these files: 9 dht.proto 10 11 It has these top-level messages: 12 Message 13 Record 14 */ 15 package dht_pb 16 17 import proto "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/gogo/protobuf/proto" 18 import math "math" 19 20 // Reference imports to suppress errors if they are not otherwise used. 21 var _ = proto.Marshal 22 var _ = math.Inf 23 24 type Message_MessageType int32 25 26 const ( 27 Message_PUT_VALUE Message_MessageType = 0 28 Message_GET_VALUE Message_MessageType = 1 29 Message_ADD_PROVIDER Message_MessageType = 2 30 Message_GET_PROVIDERS Message_MessageType = 3 31 Message_FIND_NODE Message_MessageType = 4 32 Message_PING Message_MessageType = 5 33 ) 34 35 var Message_MessageType_name = map[int32]string{ 36 0: "PUT_VALUE", 37 1: "GET_VALUE", 38 2: "ADD_PROVIDER", 39 3: "GET_PROVIDERS", 40 4: "FIND_NODE", 41 5: "PING", 42 } 43 var Message_MessageType_value = map[string]int32{ 44 "PUT_VALUE": 0, 45 "GET_VALUE": 1, 46 "ADD_PROVIDER": 2, 47 "GET_PROVIDERS": 3, 48 "FIND_NODE": 4, 49 "PING": 5, 50 } 51 52 func (x Message_MessageType) Enum() *Message_MessageType { 53 p := new(Message_MessageType) 54 *p = x 55 return p 56 } 57 func (x Message_MessageType) String() string { 58 return proto.EnumName(Message_MessageType_name, int32(x)) 59 } 60 func (x *Message_MessageType) UnmarshalJSON(data []byte) error { 61 value, err := proto.UnmarshalJSONEnum(Message_MessageType_value, data, "Message_MessageType") 62 if err != nil { 63 return err 64 } 65 *x = Message_MessageType(value) 66 return nil 67 } 68 69 type Message_ConnectionType int32 70 71 const ( 72 // sender does not have a connection to peer, and no extra information (default) 73 Message_NOT_CONNECTED Message_ConnectionType = 0 74 // sender has a live connection to peer 75 Message_CONNECTED Message_ConnectionType = 1 76 // sender recently connected to peer 77 Message_CAN_CONNECT Message_ConnectionType = 2 78 // sender recently tried to connect to peer repeatedly but failed to connect 79 // ("try" here is loose, but this should signal "made strong effort, failed") 80 Message_CANNOT_CONNECT Message_ConnectionType = 3 81 ) 82 83 var Message_ConnectionType_name = map[int32]string{ 84 0: "NOT_CONNECTED", 85 1: "CONNECTED", 86 2: "CAN_CONNECT", 87 3: "CANNOT_CONNECT", 88 } 89 var Message_ConnectionType_value = map[string]int32{ 90 "NOT_CONNECTED": 0, 91 "CONNECTED": 1, 92 "CAN_CONNECT": 2, 93 "CANNOT_CONNECT": 3, 94 } 95 96 func (x Message_ConnectionType) Enum() *Message_ConnectionType { 97 p := new(Message_ConnectionType) 98 *p = x 99 return p 100 } 101 func (x Message_ConnectionType) String() string { 102 return proto.EnumName(Message_ConnectionType_name, int32(x)) 103 } 104 func (x *Message_ConnectionType) UnmarshalJSON(data []byte) error { 105 value, err := proto.UnmarshalJSONEnum(Message_ConnectionType_value, data, "Message_ConnectionType") 106 if err != nil { 107 return err 108 } 109 *x = Message_ConnectionType(value) 110 return nil 111 } 112 113 type Message struct { 114 // defines what type of message it is. 115 Type *Message_MessageType `protobuf:"varint,1,opt,name=type,enum=dht.pb.Message_MessageType" json:"type,omitempty"` 116 // defines what coral cluster level this query/response belongs to. 117 ClusterLevelRaw *int32 `protobuf:"varint,10,opt,name=clusterLevelRaw" json:"clusterLevelRaw,omitempty"` 118 // Used to specify the key associated with this message. 119 // PUT_VALUE, GET_VALUE, ADD_PROVIDER, GET_PROVIDERS 120 Key *string `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"` 121 // Used to return a value 122 // PUT_VALUE, GET_VALUE 123 Record *Record `protobuf:"bytes,3,opt,name=record" json:"record,omitempty"` 124 // Used to return peers closer to a key in a query 125 // GET_VALUE, GET_PROVIDERS, FIND_NODE 126 CloserPeers []*Message_Peer `protobuf:"bytes,8,rep,name=closerPeers" json:"closerPeers,omitempty"` 127 // Used to return Providers 128 // GET_VALUE, ADD_PROVIDER, GET_PROVIDERS 129 ProviderPeers []*Message_Peer `protobuf:"bytes,9,rep,name=providerPeers" json:"providerPeers,omitempty"` 130 XXX_unrecognized []byte `json:"-"` 131 } 132 133 func (m *Message) Reset() { *m = Message{} } 134 func (m *Message) String() string { return proto.CompactTextString(m) } 135 func (*Message) ProtoMessage() {} 136 137 func (m *Message) GetType() Message_MessageType { 138 if m != nil && m.Type != nil { 139 return *m.Type 140 } 141 return Message_PUT_VALUE 142 } 143 144 func (m *Message) GetClusterLevelRaw() int32 { 145 if m != nil && m.ClusterLevelRaw != nil { 146 return *m.ClusterLevelRaw 147 } 148 return 0 149 } 150 151 func (m *Message) GetKey() string { 152 if m != nil && m.Key != nil { 153 return *m.Key 154 } 155 return "" 156 } 157 158 func (m *Message) GetRecord() *Record { 159 if m != nil { 160 return m.Record 161 } 162 return nil 163 } 164 165 func (m *Message) GetCloserPeers() []*Message_Peer { 166 if m != nil { 167 return m.CloserPeers 168 } 169 return nil 170 } 171 172 func (m *Message) GetProviderPeers() []*Message_Peer { 173 if m != nil { 174 return m.ProviderPeers 175 } 176 return nil 177 } 178 179 type Message_Peer struct { 180 // ID of a given peer. 181 Id *string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` 182 // multiaddrs for a given peer 183 Addrs [][]byte `protobuf:"bytes,2,rep,name=addrs" json:"addrs,omitempty"` 184 // used to signal the sender's connection capabilities to the peer 185 Connection *Message_ConnectionType `protobuf:"varint,3,opt,name=connection,enum=dht.pb.Message_ConnectionType" json:"connection,omitempty"` 186 XXX_unrecognized []byte `json:"-"` 187 } 188 189 func (m *Message_Peer) Reset() { *m = Message_Peer{} } 190 func (m *Message_Peer) String() string { return proto.CompactTextString(m) } 191 func (*Message_Peer) ProtoMessage() {} 192 193 func (m *Message_Peer) GetId() string { 194 if m != nil && m.Id != nil { 195 return *m.Id 196 } 197 return "" 198 } 199 200 func (m *Message_Peer) GetAddrs() [][]byte { 201 if m != nil { 202 return m.Addrs 203 } 204 return nil 205 } 206 207 func (m *Message_Peer) GetConnection() Message_ConnectionType { 208 if m != nil && m.Connection != nil { 209 return *m.Connection 210 } 211 return Message_NOT_CONNECTED 212 } 213 214 // Record represents a dht record that contains a value 215 // for a key value pair 216 type Record struct { 217 // The key that references this record 218 Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` 219 // The actual value this record is storing 220 Value []byte `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` 221 // hash of the authors public key 222 Author *string `protobuf:"bytes,3,opt,name=author" json:"author,omitempty"` 223 // A PKI signature for the key+value+author 224 Signature []byte `protobuf:"bytes,4,opt,name=signature" json:"signature,omitempty"` 225 XXX_unrecognized []byte `json:"-"` 226 } 227 228 func (m *Record) Reset() { *m = Record{} } 229 func (m *Record) String() string { return proto.CompactTextString(m) } 230 func (*Record) ProtoMessage() {} 231 232 func (m *Record) GetKey() string { 233 if m != nil && m.Key != nil { 234 return *m.Key 235 } 236 return "" 237 } 238 239 func (m *Record) GetValue() []byte { 240 if m != nil { 241 return m.Value 242 } 243 return nil 244 } 245 246 func (m *Record) GetAuthor() string { 247 if m != nil && m.Author != nil { 248 return *m.Author 249 } 250 return "" 251 } 252 253 func (m *Record) GetSignature() []byte { 254 if m != nil { 255 return m.Signature 256 } 257 return nil 258 } 259 260 func init() { 261 proto.RegisterEnum("dht.pb.Message_MessageType", Message_MessageType_name, Message_MessageType_value) 262 proto.RegisterEnum("dht.pb.Message_ConnectionType", Message_ConnectionType_name, Message_ConnectionType_value) 263 }