messages.pb.go 3.06 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
// 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 (
26 27 28 29 30 31
	DHTMessage_PUT_VALUE     DHTMessage_MessageType = 0
	DHTMessage_GET_VALUE     DHTMessage_MessageType = 1
	DHTMessage_ADD_PROVIDER  DHTMessage_MessageType = 2
	DHTMessage_GET_PROVIDERS DHTMessage_MessageType = 3
	DHTMessage_FIND_NODE     DHTMessage_MessageType = 4
	DHTMessage_PING          DHTMessage_MessageType = 5
32 33 34 35 36
)

var DHTMessage_MessageType_name = map[int32]string{
	0: "PUT_VALUE",
	1: "GET_VALUE",
37 38 39 40
	2: "ADD_PROVIDER",
	3: "GET_PROVIDERS",
	4: "FIND_NODE",
	5: "PING",
41 42
}
var DHTMessage_MessageType_value = map[string]int32{
43 44 45 46 47 48
	"PUT_VALUE":     0,
	"GET_VALUE":     1,
	"ADD_PROVIDER":  2,
	"GET_PROVIDERS": 3,
	"FIND_NODE":     4,
	"PING":          5,
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
}

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 {
69 70 71 72 73 74 75 76
	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"`
	// Unique ID of this message, used to match queries with responses
	Id *uint64 `protobuf:"varint,4,req,name=id" json:"id,omitempty"`
	// Signals whether or not this message is a response to another message
	Response         *bool  `protobuf:"varint,5,opt,name=response" json:"response,omitempty"`
	XXX_unrecognized []byte `json:"-"`
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
}

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
}

104 105 106 107 108 109 110
func (m *DHTMessage) GetId() uint64 {
	if m != nil && m.Id != nil {
		return *m.Id
	}
	return 0
}

111 112 113 114 115 116 117
func (m *DHTMessage) GetResponse() bool {
	if m != nil && m.Response != nil {
		return *m.Response
	}
	return false
}

118 119 120
func init() {
	proto.RegisterEnum("dht.DHTMessage_MessageType", DHTMessage_MessageType_name, DHTMessage_MessageType_value)
}