messages.pb.go 4.33 KB
Newer Older
1
// Code generated by protoc-gen-go.
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
	PBDHTMessage
13 14 15
*/
package dht

16
import proto "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/goprotobuf/proto"
17 18 19 20 21 22
import math "math"

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = math.Inf

23
type PBDHTMessage_MessageType int32
24 25

const (
26 27 28 29 30 31 32
	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
33 34
)

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

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

71
type PBDHTMessage struct {
72 73 74 75 76 77 78 79
	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               *string                   `protobuf:"bytes,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:"-"`
80 81
}

82 83 84
func (m *PBDHTMessage) Reset()         { *m = PBDHTMessage{} }
func (m *PBDHTMessage) String() string { return proto.CompactTextString(m) }
func (*PBDHTMessage) ProtoMessage()    {}
85

86
func (m *PBDHTMessage) GetType() PBDHTMessage_MessageType {
87 88 89
	if m != nil && m.Type != nil {
		return *m.Type
	}
90
	return PBDHTMessage_PUT_VALUE
91 92
}

93
func (m *PBDHTMessage) GetKey() string {
94 95 96 97 98 99
	if m != nil && m.Key != nil {
		return *m.Key
	}
	return ""
}

100
func (m *PBDHTMessage) GetValue() []byte {
101 102 103 104 105 106
	if m != nil {
		return m.Value
	}
	return nil
}

107
func (m *PBDHTMessage) GetId() string {
108 109 110
	if m != nil && m.Id != nil {
		return *m.Id
	}
111
	return ""
112 113
}

114
func (m *PBDHTMessage) GetResponse() bool {
115 116 117 118 119 120
	if m != nil && m.Response != nil {
		return *m.Response
	}
	return false
}

121
func (m *PBDHTMessage) GetSuccess() bool {
122 123 124 125 126 127
	if m != nil && m.Success != nil {
		return *m.Success
	}
	return false
}

128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
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 ""
}

159
func init() {
160
	proto.RegisterEnum("dht.PBDHTMessage_MessageType", PBDHTMessage_MessageType_name, PBDHTMessage_MessageType_value)
161
}