-
Notifications
You must be signed in to change notification settings - Fork 28
/
chunkdata.pb.go
152 lines (130 loc) · 4.22 KB
/
chunkdata.pb.go
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
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
// Code generated by protoc-gen-go.
// source: chunkdata.proto
// DO NOT EDIT!
/*
Package safebrowsing is a generated protocol buffer package.
It is generated from these files:
chunkdata.proto
It has these top-level messages:
ChunkData
*/
package safebrowsing
import proto "github.com/golang/protobuf/proto"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = math.Inf
// The chunk type is either an add or sub chunk.
type ChunkData_ChunkType int32
const (
ChunkData_ADD ChunkData_ChunkType = 0
ChunkData_SUB ChunkData_ChunkType = 1
)
var ChunkData_ChunkType_name = map[int32]string{
0: "ADD",
1: "SUB",
}
var ChunkData_ChunkType_value = map[string]int32{
"ADD": 0,
"SUB": 1,
}
func (x ChunkData_ChunkType) Enum() *ChunkData_ChunkType {
p := new(ChunkData_ChunkType)
*p = x
return p
}
func (x ChunkData_ChunkType) String() string {
return proto.EnumName(ChunkData_ChunkType_name, int32(x))
}
func (x *ChunkData_ChunkType) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(ChunkData_ChunkType_value, data, "ChunkData_ChunkType")
if err != nil {
return err
}
*x = ChunkData_ChunkType(value)
return nil
}
// Prefix type which currently is either 4B or 32B. The default is set
// to the prefix length, so it doesn't have to be set at all for most
// chunks.
type ChunkData_PrefixType int32
const (
ChunkData_PREFIX_4B ChunkData_PrefixType = 0
ChunkData_FULL_32B ChunkData_PrefixType = 1
)
var ChunkData_PrefixType_name = map[int32]string{
0: "PREFIX_4B",
1: "FULL_32B",
}
var ChunkData_PrefixType_value = map[string]int32{
"PREFIX_4B": 0,
"FULL_32B": 1,
}
func (x ChunkData_PrefixType) Enum() *ChunkData_PrefixType {
p := new(ChunkData_PrefixType)
*p = x
return p
}
func (x ChunkData_PrefixType) String() string {
return proto.EnumName(ChunkData_PrefixType_name, int32(x))
}
func (x *ChunkData_PrefixType) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(ChunkData_PrefixType_value, data, "ChunkData_PrefixType")
if err != nil {
return err
}
*x = ChunkData_PrefixType(value)
return nil
}
// Chunk data encoding format for the shavar-proto list format.
type ChunkData struct {
ChunkNumber *int32 `protobuf:"varint,1,req,name=chunk_number" json:"chunk_number,omitempty"`
ChunkType *ChunkData_ChunkType `protobuf:"varint,2,opt,name=chunk_type,enum=safebrowsing.ChunkData_ChunkType,def=0" json:"chunk_type,omitempty"`
PrefixType *ChunkData_PrefixType `protobuf:"varint,3,opt,name=prefix_type,enum=safebrowsing.ChunkData_PrefixType,def=0" json:"prefix_type,omitempty"`
// Stores all SHA256 add or sub prefixes or full-length hashes. The number
// of hashes can be inferred from the length of the hashes string and the
// prefix type above.
Hashes []byte `protobuf:"bytes,4,opt,name=hashes" json:"hashes,omitempty"`
// Sub chunks also encode one add chunk number for every hash stored above.
AddNumbers []int32 `protobuf:"varint,5,rep,packed,name=add_numbers" json:"add_numbers,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *ChunkData) Reset() { *m = ChunkData{} }
func (m *ChunkData) String() string { return proto.CompactTextString(m) }
func (*ChunkData) ProtoMessage() {}
const Default_ChunkData_ChunkType ChunkData_ChunkType = ChunkData_ADD
const Default_ChunkData_PrefixType ChunkData_PrefixType = ChunkData_PREFIX_4B
func (m *ChunkData) GetChunkNumber() int32 {
if m != nil && m.ChunkNumber != nil {
return *m.ChunkNumber
}
return 0
}
func (m *ChunkData) GetChunkType() ChunkData_ChunkType {
if m != nil && m.ChunkType != nil {
return *m.ChunkType
}
return Default_ChunkData_ChunkType
}
func (m *ChunkData) GetPrefixType() ChunkData_PrefixType {
if m != nil && m.PrefixType != nil {
return *m.PrefixType
}
return Default_ChunkData_PrefixType
}
func (m *ChunkData) GetHashes() []byte {
if m != nil {
return m.Hashes
}
return nil
}
func (m *ChunkData) GetAddNumbers() []int32 {
if m != nil {
return m.AddNumbers
}
return nil
}
func init() {
proto.RegisterEnum("safebrowsing.ChunkData_ChunkType", ChunkData_ChunkType_name, ChunkData_ChunkType_value)
proto.RegisterEnum("safebrowsing.ChunkData_PrefixType", ChunkData_PrefixType_name, ChunkData_PrefixType_value)
}