From 8cd5f6ff8e36328c48c354d3f1d0add03e50b356 Mon Sep 17 00:00:00 2001 From: zbot Date: Thu, 7 Apr 2016 08:31:51 -0600 Subject: [PATCH 1/3] [#117147861] Update ChangeLog to start feature "Add bulk categorizations to zvelo.io/msg" https://www.pivotaltracker.com/story/show/117147861 --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 35cfce5..b4c9441 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-04-07 Bob Uhl + + * Start feature "Add bulk categorizations to zvelo.io/msg" + https://www.pivotaltracker.com/story/show/117147861 + 2016-03-16 RJ Nanjegowda * Start feature "Modify DS for Malicious" From 611220ac04fa41a299f140f48760dec638b5c0fd Mon Sep 17 00:00:00 2001 From: zbot Date: Thu, 7 Apr 2016 08:31:53 -0600 Subject: [PATCH 2/3] [#117147861] Added pull request url to ChangeLog https://github.com/zvelo/msg/pull/5 --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index b4c9441..a728f8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ * Start feature "Add bulk categorizations to zvelo.io/msg" https://www.pivotaltracker.com/story/show/117147861 + https://github.com/zvelo/msg/pull/5 2016-03-16 RJ Nanjegowda From 88f33e1174aac8fa3d83092d17aaa27f4f422c70 Mon Sep 17 00:00:00 2001 From: Bob Uhl Date: Thu, 7 Apr 2016 08:34:55 -0600 Subject: [PATCH 3/3] Add bulk categorizations These are used by the Seed and Stream APIs to return bulk categorization information. --- categorization.proto | 14 ++++++ go-msg/categorization.pb.go | 89 +++++++++++++++++++++++++++++++++++++ go-msg/dataset.pb.go | 37 ++++----------- go-msg/query_result.pb.go | 12 ++--- go-msg/status.pb.go | 6 +-- go-msg/zvelo-api.pb.go | 18 ++++---- 6 files changed, 129 insertions(+), 47 deletions(-) create mode 100644 categorization.proto create mode 100644 go-msg/categorization.pb.go diff --git a/categorization.proto b/categorization.proto new file mode 100644 index 0000000..5ea040a --- /dev/null +++ b/categorization.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +package msg; + +import "dataset.proto"; + +message Categorization { + string url = 1; + DataSet dataset = 2; +} + +message Categorizations { + repeated Categorization categorizations = 1; +} diff --git a/go-msg/categorization.pb.go b/go-msg/categorization.pb.go new file mode 100644 index 0000000..138d28e --- /dev/null +++ b/go-msg/categorization.pb.go @@ -0,0 +1,89 @@ +// Code generated by protoc-gen-go. +// source: categorization.proto +// DO NOT EDIT! + +/* +Package msg is a generated protocol buffer package. + +It is generated from these files: + categorization.proto + dataset.proto + query_result.proto + status.proto + zvelo-api.proto + +It has these top-level messages: + Categorization + Categorizations + DataSet + QueryResult + Status + QueryURLRequests + QueryContentRequests + QueryReply +*/ +package msg + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +const _ = proto.ProtoPackageIsVersion1 + +type Categorization struct { + Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` + Dataset *DataSet `protobuf:"bytes,2,opt,name=dataset" json:"dataset,omitempty"` +} + +func (m *Categorization) Reset() { *m = Categorization{} } +func (m *Categorization) String() string { return proto.CompactTextString(m) } +func (*Categorization) ProtoMessage() {} +func (*Categorization) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Categorization) GetDataset() *DataSet { + if m != nil { + return m.Dataset + } + return nil +} + +type Categorizations struct { + Categorizations []*Categorization `protobuf:"bytes,1,rep,name=categorizations" json:"categorizations,omitempty"` +} + +func (m *Categorizations) Reset() { *m = Categorizations{} } +func (m *Categorizations) String() string { return proto.CompactTextString(m) } +func (*Categorizations) ProtoMessage() {} +func (*Categorizations) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Categorizations) GetCategorizations() []*Categorization { + if m != nil { + return m.Categorizations + } + return nil +} + +func init() { + proto.RegisterType((*Categorization)(nil), "msg.Categorization") + proto.RegisterType((*Categorizations)(nil), "msg.Categorizations") +} + +var fileDescriptor0 = []byte{ + // 144 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x12, 0x49, 0x4e, 0x2c, 0x49, + 0x4d, 0xcf, 0x2f, 0xca, 0xac, 0x4a, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, + 0x17, 0x62, 0xce, 0x2d, 0x4e, 0x97, 0xe2, 0x4d, 0x49, 0x2c, 0x49, 0x2c, 0x4e, 0x2d, 0x81, 0x88, + 0x29, 0x79, 0x71, 0xf1, 0x39, 0xa3, 0xa8, 0x15, 0x12, 0xe0, 0x62, 0x2e, 0x2d, 0xca, 0x91, 0x60, + 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0x31, 0x85, 0xd4, 0xb8, 0xd8, 0xa1, 0x9a, 0x24, 0x98, 0x80, + 0xa2, 0xdc, 0x46, 0x3c, 0x7a, 0x40, 0x93, 0xf4, 0x5c, 0x80, 0x62, 0xc1, 0xa9, 0x25, 0x41, 0x30, + 0x49, 0xa5, 0x00, 0x2e, 0x7e, 0x54, 0xb3, 0x8a, 0x85, 0x6c, 0xb9, 0xf8, 0x51, 0x9d, 0x52, 0x0c, + 0x34, 0x98, 0x19, 0x68, 0x84, 0x30, 0xd8, 0x08, 0x54, 0xe5, 0x41, 0xe8, 0x6a, 0x93, 0xd8, 0xc0, + 0x8e, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x5f, 0xcf, 0x78, 0x09, 0xd0, 0x00, 0x00, 0x00, +} diff --git a/go-msg/dataset.pb.go b/go-msg/dataset.pb.go index a2d0a55..da60ca7 100644 --- a/go-msg/dataset.pb.go +++ b/go-msg/dataset.pb.go @@ -2,23 +2,6 @@ // source: dataset.proto // DO NOT EDIT! -/* -Package msg is a generated protocol buffer package. - -It is generated from these files: - dataset.proto - query_result.proto - status.proto - zvelo-api.proto - -It has these top-level messages: - DataSet - QueryResult - Status - QueryURLRequests - QueryContentRequests - QueryReply -*/ package msg import proto "github.com/golang/protobuf/proto" @@ -30,10 +13,6 @@ var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -const _ = proto.ProtoPackageIsVersion1 - type DataSetType int32 const ( @@ -60,7 +39,7 @@ var DataSetType_value = map[string]int32{ func (x DataSetType) String() string { return proto.EnumName(DataSetType_name, int32(x)) } -func (DataSetType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (DataSetType) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } type DataSet struct { Categorization *DataSet_Categorization `protobuf:"bytes,1,opt,name=categorization" json:"categorization,omitempty"` @@ -73,7 +52,7 @@ type DataSet struct { func (m *DataSet) Reset() { *m = DataSet{} } func (m *DataSet) String() string { return proto.CompactTextString(m) } func (*DataSet) ProtoMessage() {} -func (*DataSet) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (*DataSet) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } func (m *DataSet) GetCategorization() *DataSet_Categorization { if m != nil { @@ -110,7 +89,7 @@ type DataSet_Categorization struct { func (m *DataSet_Categorization) Reset() { *m = DataSet_Categorization{} } func (m *DataSet_Categorization) String() string { return proto.CompactTextString(m) } func (*DataSet_Categorization) ProtoMessage() {} -func (*DataSet_Categorization) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } +func (*DataSet_Categorization) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 0} } type DataSet_AdFraud struct { Fraud bool `protobuf:"varint,1,opt,name=fraud" json:"fraud,omitempty"` @@ -120,7 +99,7 @@ type DataSet_AdFraud struct { func (m *DataSet_AdFraud) Reset() { *m = DataSet_AdFraud{} } func (m *DataSet_AdFraud) String() string { return proto.CompactTextString(m) } func (*DataSet_AdFraud) ProtoMessage() {} -func (*DataSet_AdFraud) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 1} } +func (*DataSet_AdFraud) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 1} } type DataSet_Malicious struct { Category int32 `protobuf:"varint,1,opt,name=category" json:"category,omitempty"` @@ -131,17 +110,17 @@ type DataSet_Malicious struct { func (m *DataSet_Malicious) Reset() { *m = DataSet_Malicious{} } func (m *DataSet_Malicious) String() string { return proto.CompactTextString(m) } func (*DataSet_Malicious) ProtoMessage() {} -func (*DataSet_Malicious) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 2} } +func (*DataSet_Malicious) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 2} } type DataSet_Echo struct { - RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId" json:"request_id,omitempty"` + RequestId string `protobuf:"bytes,1,opt,name=request_id" json:"request_id,omitempty"` Url string `protobuf:"bytes,2,opt,name=url" json:"url,omitempty"` } func (m *DataSet_Echo) Reset() { *m = DataSet_Echo{} } func (m *DataSet_Echo) String() string { return proto.CompactTextString(m) } func (*DataSet_Echo) ProtoMessage() {} -func (*DataSet_Echo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 3} } +func (*DataSet_Echo) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 3} } func init() { proto.RegisterType((*DataSet)(nil), "msg.DataSet") @@ -152,7 +131,7 @@ func init() { proto.RegisterEnum("msg.DataSetType", DataSetType_name, DataSetType_value) } -var fileDescriptor0 = []byte{ +var fileDescriptor1 = []byte{ // 359 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x7c, 0x52, 0x4d, 0x6b, 0xea, 0x40, 0x14, 0x7d, 0x1a, 0x63, 0xcc, 0x15, 0x25, 0xef, 0x22, 0x8f, 0x90, 0xf7, 0x1e, 0x48, 0xa1, 0x20, diff --git a/go-msg/query_result.pb.go b/go-msg/query_result.pb.go index 2ed809e..1bc69bc 100644 --- a/go-msg/query_result.pb.go +++ b/go-msg/query_result.pb.go @@ -14,18 +14,18 @@ var _ = fmt.Errorf var _ = math.Inf type QueryResult struct { - RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId" json:"request_id,omitempty"` - TrackingId string `protobuf:"bytes,2,opt,name=tracking_id,json=trackingId" json:"tracking_id,omitempty"` + RequestId string `protobuf:"bytes,1,opt,name=request_id" json:"request_id,omitempty"` + TrackingId string `protobuf:"bytes,2,opt,name=tracking_id" json:"tracking_id,omitempty"` Status *Status `protobuf:"bytes,4,opt,name=status" json:"status,omitempty"` - RequestDataset []DataSetType `protobuf:"varint,6,rep,name=request_dataset,json=requestDataset,enum=msg.DataSetType" json:"request_dataset,omitempty"` - ResponseDataset *DataSet `protobuf:"bytes,7,opt,name=response_dataset,json=responseDataset" json:"response_dataset,omitempty"` + RequestDataset []DataSetType `protobuf:"varint,6,rep,name=request_dataset,enum=msg.DataSetType" json:"request_dataset,omitempty"` + ResponseDataset *DataSet `protobuf:"bytes,7,opt,name=response_dataset" json:"response_dataset,omitempty"` Url string `protobuf:"bytes,8,opt,name=url" json:"url,omitempty"` } func (m *QueryResult) Reset() { *m = QueryResult{} } func (m *QueryResult) String() string { return proto.CompactTextString(m) } func (*QueryResult) ProtoMessage() {} -func (*QueryResult) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } +func (*QueryResult) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } func (m *QueryResult) GetStatus() *Status { if m != nil { @@ -45,7 +45,7 @@ func init() { proto.RegisterType((*QueryResult)(nil), "msg.QueryResult") } -var fileDescriptor1 = []byte{ +var fileDescriptor2 = []byte{ // 236 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x4c, 0x90, 0x31, 0x4f, 0xc3, 0x30, 0x10, 0x85, 0xd5, 0x3a, 0x98, 0xf6, 0x5c, 0x5a, 0xcb, 0x93, 0x55, 0x09, 0x51, 0xc1, 0xd2, 0x29, diff --git a/go-msg/status.pb.go b/go-msg/status.pb.go index bc9900f..fb9698b 100644 --- a/go-msg/status.pb.go +++ b/go-msg/status.pb.go @@ -77,7 +77,7 @@ var Status_Code_value = map[string]int32{ func (x Status_Code) String() string { return proto.EnumName(Status_Code_name, int32(x)) } -func (Status_Code) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{0, 0} } +func (Status_Code) EnumDescriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 0} } type Status struct { Code Status_Code `protobuf:"varint,1,opt,name=code,enum=msg.Status_Code" json:"code,omitempty"` @@ -87,14 +87,14 @@ type Status struct { func (m *Status) Reset() { *m = Status{} } func (m *Status) String() string { return proto.CompactTextString(m) } func (*Status) ProtoMessage() {} -func (*Status) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } +func (*Status) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } func init() { proto.RegisterType((*Status)(nil), "msg.Status") proto.RegisterEnum("msg.Status_Code", Status_Code_name, Status_Code_value) } -var fileDescriptor2 = []byte{ +var fileDescriptor3 = []byte{ // 365 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x3c, 0x91, 0xcf, 0x4e, 0x2a, 0x31, 0x14, 0xc6, 0xef, 0x50, 0xc2, 0x5c, 0x0a, 0x97, 0x5b, 0xab, 0x26, 0xc4, 0x8d, 0x86, 0xb8, 0x70, diff --git a/go-msg/zvelo-api.pb.go b/go-msg/zvelo-api.pb.go index 9c5534d..22b44cf 100644 --- a/go-msg/zvelo-api.pb.go +++ b/go-msg/zvelo-api.pb.go @@ -18,28 +18,28 @@ type QueryURLRequests struct { Dataset []DataSetType `protobuf:"varint,2,rep,name=dataset,enum=msg.DataSetType" json:"dataset,omitempty"` Callback string `protobuf:"bytes,3,opt,name=callback" json:"callback,omitempty"` Poll bool `protobuf:"varint,4,opt,name=poll" json:"poll,omitempty"` - PartialResults bool `protobuf:"varint,5,opt,name=partial_results,json=partialResults" json:"partial_results,omitempty"` + PartialResults bool `protobuf:"varint,5,opt,name=partial_results" json:"partial_results,omitempty"` Accept string `protobuf:"bytes,6,opt,name=accept" json:"accept,omitempty"` } func (m *QueryURLRequests) Reset() { *m = QueryURLRequests{} } func (m *QueryURLRequests) String() string { return proto.CompactTextString(m) } func (*QueryURLRequests) ProtoMessage() {} -func (*QueryURLRequests) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } +func (*QueryURLRequests) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} } type QueryContentRequests struct { Content []*QueryContentRequests_URLContent `protobuf:"bytes,1,rep,name=content" json:"content,omitempty"` Dataset []DataSetType `protobuf:"varint,2,rep,name=dataset,enum=msg.DataSetType" json:"dataset,omitempty"` Callback string `protobuf:"bytes,3,opt,name=callback" json:"callback,omitempty"` Poll bool `protobuf:"varint,4,opt,name=poll" json:"poll,omitempty"` - PartialResults bool `protobuf:"varint,5,opt,name=partial_results,json=partialResults" json:"partial_results,omitempty"` + PartialResults bool `protobuf:"varint,5,opt,name=partial_results" json:"partial_results,omitempty"` Accept string `protobuf:"bytes,6,opt,name=accept" json:"accept,omitempty"` } func (m *QueryContentRequests) Reset() { *m = QueryContentRequests{} } func (m *QueryContentRequests) String() string { return proto.CompactTextString(m) } func (*QueryContentRequests) ProtoMessage() {} -func (*QueryContentRequests) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} } +func (*QueryContentRequests) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{1} } func (m *QueryContentRequests) GetContent() []*QueryContentRequests_URLContent { if m != nil { @@ -60,7 +60,7 @@ func (m *QueryContentRequests_URLContent) Reset() { *m = QueryContentReq func (m *QueryContentRequests_URLContent) String() string { return proto.CompactTextString(m) } func (*QueryContentRequests_URLContent) ProtoMessage() {} func (*QueryContentRequests_URLContent) Descriptor() ([]byte, []int) { - return fileDescriptor3, []int{1, 0} + return fileDescriptor4, []int{1, 0} } func (m *QueryContentRequests_URLContent) GetHeader() map[string]string { @@ -72,17 +72,17 @@ func (m *QueryContentRequests_URLContent) GetHeader() map[string]string { type QueryReply struct { Status *Status `protobuf:"bytes,1,opt,name=status" json:"status,omitempty"` - RequestId []string `protobuf:"bytes,2,rep,name=request_id,json=requestId" json:"request_id,omitempty"` + RequestId []string `protobuf:"bytes,2,rep,name=request_id" json:"request_id,omitempty"` // the target of QueryStatus, to ensure that the QueryStatus call // goes to the same cluster as the original call. // Will only be set if user set p=true in request. - StatusUrl string `protobuf:"bytes,3,opt,name=status_url,json=statusUrl" json:"status_url,omitempty"` + StatusUrl string `protobuf:"bytes,3,opt,name=status_url" json:"status_url,omitempty"` } func (m *QueryReply) Reset() { *m = QueryReply{} } func (m *QueryReply) String() string { return proto.CompactTextString(m) } func (*QueryReply) ProtoMessage() {} -func (*QueryReply) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{2} } +func (*QueryReply) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{2} } func (m *QueryReply) GetStatus() *Status { if m != nil { @@ -98,7 +98,7 @@ func init() { proto.RegisterType((*QueryReply)(nil), "msg.QueryReply") } -var fileDescriptor3 = []byte{ +var fileDescriptor4 = []byte{ // 400 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xcc, 0x93, 0xc1, 0x6a, 0xdb, 0x40, 0x10, 0x86, 0x91, 0x64, 0xcb, 0xf6, 0xa8, 0xb5, 0xcd, 0x62, 0x8a, 0x10, 0x14, 0x8c, 0x5b, 0x68,