// 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: DHTMessage */ 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 type DHTMessage_MessageType int32 const ( DHTMessage_PUT_VALUE DHTMessage_MessageType = 0 DHTMessage_GET_VALUE DHTMessage_MessageType = 1 DHTMessage_PING DHTMessage_MessageType = 2 DHTMessage_FIND_NODE DHTMessage_MessageType = 3 ) var DHTMessage_MessageType_name = map[int32]string{ 0: "PUT_VALUE", 1: "GET_VALUE", 2: "PING", 3: "FIND_NODE", } var DHTMessage_MessageType_value = map[string]int32{ "PUT_VALUE": 0, "GET_VALUE": 1, "PING": 2, "FIND_NODE": 3, } func (x DHTMessage_MessageType) Enum() *DHTMessage_MessageType { p := new(DHTMessage_MessageType) *p = x return p } func (x DHTMessage_MessageType) String() string { return proto.EnumName(DHTMessage_MessageType_name, int32(x)) } func (x *DHTMessage_MessageType) UnmarshalJSON(data []byte) error { value, err := proto.UnmarshalJSONEnum(DHTMessage_MessageType_value, data, "DHTMessage_MessageType") if err != nil { return err } *x = DHTMessage_MessageType(value) return nil } type DHTMessage struct { Type *DHTMessage_MessageType `protobuf:"varint,1,req,name=type,enum=dht.DHTMessage_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"` XXX_unrecognized []byte `json:"-"` } func (m *DHTMessage) Reset() { *m = DHTMessage{} } func (m *DHTMessage) String() string { return proto.CompactTextString(m) } func (*DHTMessage) ProtoMessage() {} func (m *DHTMessage) GetType() DHTMessage_MessageType { if m != nil && m.Type != nil { return *m.Type } return DHTMessage_PUT_VALUE } func (m *DHTMessage) GetKey() string { if m != nil && m.Key != nil { return *m.Key } return "" } func (m *DHTMessage) GetValue() []byte { if m != nil { return m.Value } return nil } func init() { proto.RegisterEnum("dht.DHTMessage_MessageType", DHTMessage_MessageType_name, DHTMessage_MessageType_value) }