From 6ef70ef3b8ec3d60453227bbdf725df2417f15bf Mon Sep 17 00:00:00 2001 From: "insanity@loafle.com" Date: Sat, 20 May 2017 18:47:21 +0900 Subject: [PATCH] proto --- initialize/cmd | 1 + task/cmd | 1 + task/task.pb.go | 45 +++++++++++++++++++++++++-------------------- task/task.proto | 4 +++- 4 files changed, 30 insertions(+), 21 deletions(-) create mode 100644 initialize/cmd create mode 100644 task/cmd diff --git a/initialize/cmd b/initialize/cmd new file mode 100644 index 0000000..9949ae9 --- /dev/null +++ b/initialize/cmd @@ -0,0 +1 @@ +protoc -I initialize/ initialize/initialize.proto --go_out=plugins=grpc:initialize diff --git a/task/cmd b/task/cmd new file mode 100644 index 0000000..2f5f7db --- /dev/null +++ b/task/cmd @@ -0,0 +1 @@ +protoc -I$GOPATH/src/ -I task/ task/task.proto --go_out=plugins=grpc:task diff --git a/task/task.pb.go b/task/task.pb.go index 17e24c9..df43bcf 100644 --- a/task/task.pb.go +++ b/task/task.pb.go @@ -17,6 +17,7 @@ package task import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import commons "loafle.com/overflow/central_api_gateway/commons" import ( context "golang.org/x/net/context" @@ -43,9 +44,9 @@ func (*Empty) ProtoMessage() {} func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } type TaskInfo struct { - Command string `protobuf:"bytes,1,opt,name=command" json:"command,omitempty"` - TaskId string `protobuf:"bytes,2,opt,name=taskId" json:"taskId,omitempty"` - Data map[string]string `protobuf:"bytes,3,rep,name=data" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Command commons.TaskEventType `protobuf:"varint,1,opt,name=command,enum=TaskEventType" json:"command,omitempty"` + TaskId string `protobuf:"bytes,2,opt,name=taskId" json:"taskId,omitempty"` + Data map[string]string `protobuf:"bytes,3,rep,name=data" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` } func (m *TaskInfo) Reset() { *m = TaskInfo{} } @@ -53,11 +54,11 @@ func (m *TaskInfo) String() string { return proto.CompactTextString(m func (*TaskInfo) ProtoMessage() {} func (*TaskInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } -func (m *TaskInfo) GetCommand() string { +func (m *TaskInfo) GetCommand() commons.TaskEventType { if m != nil { return m.Command } - return "" + return commons.TaskEventType_TASK_POL_INTERVAL_UPDATE } func (m *TaskInfo) GetTaskId() string { @@ -171,19 +172,23 @@ var _Task_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("task.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 218 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0x49, 0x2c, 0xce, - 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x57, 0x62, 0xe7, 0x62, 0x75, 0xcd, 0x2d, 0x28, 0xa9, 0x54, - 0x9a, 0xc7, 0xc8, 0xc5, 0x11, 0x92, 0x58, 0x9c, 0xed, 0x99, 0x97, 0x96, 0x2f, 0x24, 0xc1, 0xc5, - 0x9e, 0x9c, 0x9f, 0x9b, 0x9b, 0x98, 0x97, 0x22, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x19, 0x04, 0xe3, - 0x0a, 0x89, 0x71, 0xb1, 0x81, 0x74, 0x7b, 0xa6, 0x48, 0x30, 0x81, 0x25, 0xa0, 0x3c, 0x21, 0x75, - 0x2e, 0x96, 0x94, 0xc4, 0x92, 0x44, 0x09, 0x66, 0x05, 0x66, 0x0d, 0x6e, 0x23, 0x61, 0x3d, 0x98, - 0x51, 0x7a, 0x2e, 0x89, 0x25, 0x89, 0xae, 0x79, 0x25, 0x45, 0x95, 0x41, 0x60, 0x05, 0x52, 0xe6, - 0x5c, 0x9c, 0x70, 0x21, 0x21, 0x01, 0x2e, 0xe6, 0xec, 0xd4, 0x4a, 0xa8, 0x1d, 0x20, 0xa6, 0x90, - 0x08, 0x17, 0x6b, 0x59, 0x62, 0x4e, 0x69, 0x2a, 0xd4, 0x78, 0x08, 0xc7, 0x8a, 0xc9, 0x82, 0x51, - 0xc9, 0x10, 0xe2, 0x3e, 0x9f, 0xcc, 0xe2, 0x12, 0x21, 0x55, 0x2e, 0x8e, 0x12, 0x28, 0x5b, 0x82, - 0x11, 0x6c, 0x23, 0x27, 0xdc, 0xc6, 0x20, 0xb8, 0x94, 0x91, 0x16, 0x17, 0x0b, 0x48, 0x54, 0x48, - 0x89, 0x8b, 0xbb, 0x28, 0xb5, 0xb0, 0x34, 0xb5, 0xb8, 0x04, 0xcc, 0x65, 0xd3, 0x03, 0x7b, 0x59, - 0x0a, 0xa2, 0x07, 0xa4, 0x52, 0x89, 0x21, 0x89, 0x0d, 0x1c, 0x1e, 0xc6, 0x80, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xc7, 0x05, 0x41, 0xed, 0x1d, 0x01, 0x00, 0x00, + // 276 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x3c, 0x50, 0xcd, 0x6a, 0xf3, 0x40, + 0x0c, 0xfc, 0x36, 0xff, 0x56, 0x20, 0x7c, 0x6c, 0x4b, 0x31, 0x39, 0x05, 0x43, 0xa9, 0xe9, 0x61, + 0x43, 0xdd, 0x43, 0x4b, 0xa1, 0xb7, 0xfa, 0x10, 0xe8, 0xc9, 0xe4, 0x1e, 0x54, 0x7b, 0x5d, 0x82, + 0xed, 0x5d, 0xd7, 0x56, 0x1c, 0xfc, 0x52, 0x7d, 0xc6, 0xb2, 0xeb, 0x9f, 0x93, 0x34, 0x9a, 0x91, + 0x46, 0x0c, 0x00, 0x61, 0x9d, 0x89, 0xb2, 0xd2, 0xa4, 0xb7, 0xef, 0xb9, 0xc6, 0x34, 0x97, 0x22, + 0xd6, 0xc5, 0x5e, 0x37, 0xb2, 0x4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xff, 0x5e, 0xaf, 0x68, 0x2f, + 0x6c, 0x01, 0x00, 0x00, } diff --git a/task/task.proto b/task/task.proto index b5dba5b..e7b7927 100644 --- a/task/task.proto +++ b/task/task.proto @@ -1,9 +1,11 @@ syntax = "proto3"; +import "loafle.com/overflow/central_api_gateway/commons/commons.proto"; + message Empty {} message TaskInfo { - TaskEvent command = 1; + TaskEventType command = 1; string taskId = 2; map data = 3; }