diff --git a/msg.pb.go b/msg.pb.go index 74c25ea..69338f5 100644 --- a/msg.pb.go +++ b/msg.pb.go @@ -20,6 +20,34 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +type MyMsg_TYPE int32 + +const ( + MyMsg_DATA MyMsg_TYPE = 0 + MyMsg_PING MyMsg_TYPE = 1 + MyMsg_CATCH MyMsg_TYPE = 2 +) + +var MyMsg_TYPE_name = map[int32]string{ + 0: "DATA", + 1: "PING", + 2: "CATCH", +} + +var MyMsg_TYPE_value = map[string]int32{ + "DATA": 0, + "PING": 1, + "CATCH": 2, +} + +func (x MyMsg_TYPE) String() string { + return proto.EnumName(MyMsg_TYPE_name, int32(x)) +} + +func (MyMsg_TYPE) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_c06e4cca6c2cc899, []int{0, 0} +} + type MyMsg struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Type int32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"` @@ -219,6 +247,7 @@ func (m *Frame) GetDataid() []int32 { } func init() { + proto.RegisterEnum("MyMsg_TYPE", MyMsg_TYPE_name, MyMsg_TYPE_value) proto.RegisterType((*MyMsg)(nil), "MyMsg") proto.RegisterType((*Frame)(nil), "Frame") } @@ -226,24 +255,27 @@ func init() { func init() { proto.RegisterFile("msg.proto", fileDescriptor_c06e4cca6c2cc899) } var fileDescriptor_c06e4cca6c2cc899 = []byte{ - // 302 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0xcd, 0x4e, 0x02, 0x31, - 0x10, 0xc7, 0xb3, 0xbb, 0x74, 0x81, 0x11, 0x89, 0x8e, 0x1f, 0x99, 0x78, 0xda, 0x90, 0x98, 0x70, - 0xd1, 0x83, 0xbe, 0x01, 0x07, 0x6f, 0x5c, 0x1a, 0x4f, 0x5e, 0x48, 0xa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, 0xdf, 0x0c, 0xc4, 0x8b, 0x57, 0xce, 0x1c, 0x69, 0x65, 0xa7, 0xb4, 0xf6, 0x9b, 0x98, - 0xe1, 0x40, 0x26, 0x85, 0x77, 0x30, 0x88, 0x6f, 0x5c, 0xcf, 0x1c, 0x0b, 0x79, 0xd4, 0xe9, 0x0a, - 0x3d, 0xde, 0x92, 0xae, 0xc0, 0x64, 0xc5, 0x29, 0xd9, 0xf8, 0x5a, 0x4d, 0x65, 0x55, 0x44, 0xb2, - 0x7b, 0x35, 0x1b, 0xbd, 0x41, 0x6b, 0x9b, 0x3a, 0x6c, 0x9b, 0xc6, 0x7c, 0x2e, 0x4b, 0xc6, 0xfd, - 0xfc, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x8f, 0x2a, 0xd3, 0xc5, 0xed, 0x01, 0x00, 0x00, + // 339 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x51, 0xcb, 0x6e, 0xe2, 0x30, + 0x14, 0x1d, 0x27, 0x71, 0x48, 0xee, 0x30, 0x28, 0x73, 0x67, 0x5a, 0x59, 0x5d, 0x45, 0x48, 0x48, + 0x6c, 0xda, 0x45, 0xfb, 0x05, 0x40, 0x9f, 0x0b, 0x2a, 0x14, 0x65, 0xd3, 0x6e, 0x50, 0x20, 0x26, + 0xb5, 0xda, 0x84, 0x28, 0x31, 0x6a, 0xe9, 0x2f, 0xf4, 0x2f, 0xfb, 0x25, 0x95, 0x2f, 0x06, 0x89, + 0x95, 0xcf, 0x4b, 0xb6, 0x75, 0x0e, 0x84, 0x65, 0x5b, 0x5c, 0xd4, 0xcd, 0x5a, 0xaf, 0xfb, 0xdf, + 0x0e, 0xf0, 0xe9, 0x76, 0xda, 0x16, 0xd8, 0x03, 0x47, 0xe5, 0x82, 0xc5, 0x6c, 0x18, 0x26, 0x8e, + 0xca, 0x11, 0xc1, 0xd3, 0xdb, 0x5a, 0x0a,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0x54, 0xb7, 0x9b, + 0x1c, 0xb8, 0x1d, 0xcb, 0xa3, 0x5b, 0xec, 0x58, 0x34, 0x00, 0x3f, 0x1e, 0xc0, 0x9c, 0x2a, 0x17, + 0x7e, 0xec, 0x9a, 0x01, 0x76, 0x6c, 0xdc, 0x7d, 0x86, 0x5a, 0x55, 0x85, 0xde, 0x54, 0x95, 0x7c, + 0x5b, 0xf8, 0xb4, 0xca, 0xd5, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb6, 0x1b, 0xbb, 0x28, 0x14, + 0x02, 0x00, 0x00, } diff --git a/msg.proto b/msg.proto index d13a95f..7c8086b 100644 --- a/msg.proto +++ b/msg.proto @@ -1,6 +1,12 @@ syntax = "proto3"; option go_package = "pingtunnel"; message MyMsg { + enum TYPE { + DATA = 0; + PING = 1; + CATCH = 2; + } + string id = 1; int32 type = 2; string target = 3; diff --git a/pingtunnel.go b/pingtunnel.go index f2a1884..13ccd9e 100644 --- a/pingtunnel.go +++ b/pingtunnel.go @@ -19,7 +19,6 @@ const ( DATA uint32 = 0x01010101 PING uint32 = 0x02020202 CATCH uint32 = 0x03030303 - END uint32 = 0xAAAABBBB ) type MyMsg struct {