commit 1f5efc8eed50583f0c4498cf81e2722cfb443a00 Author: aozhiwei Date: Thu Aug 27 15:43:18 2020 +0800 init diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..3a36331 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module f5 + +require github.com/golang/protobuf v1.4.2 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..4630df5 --- /dev/null +++ b/go.sum @@ -0,0 +1,18 @@ +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= diff --git a/im/go.mod b/im/go.mod new file mode 100644 index 0000000..9f48406 --- /dev/null +++ b/im/go.mod @@ -0,0 +1 @@ +package im diff --git a/im/im_msgid.pb.go b/im/im_msgid.pb.go new file mode 100644 index 0000000..b7d5e11 --- /dev/null +++ b/im/im_msgid.pb.go @@ -0,0 +1,82 @@ +// Code generated by protoc-gen-go. +// source: im_msgid.proto +// DO NOT EDIT! + +/* +Package im is a generated protocol buffer package. + +It is generated from these files: + im_msgid.proto + im_proto.proto + +It has these top-level messages: + IMSocketConnect + IMSocketDisconnect +*/ +package im + +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. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +// 消息id定义 +type IMMessageIdE int32 + +const ( + IMMessageIdE__IMSocketConnect IMMessageIdE = 1 + IMMessageIdE__IMSocketDisconnect IMMessageIdE = 2 +) + +var IMMessageIdE_name = map[int32]string{ + 1: "_IMSocketConnect", + 2: "_IMSocketDisconnect", +} +var IMMessageIdE_value = map[string]int32{ + "_IMSocketConnect": 1, + "_IMSocketDisconnect": 2, +} + +func (x IMMessageIdE) Enum() *IMMessageIdE { + p := new(IMMessageIdE) + *p = x + return p +} +func (x IMMessageIdE) String() string { + return proto.EnumName(IMMessageIdE_name, int32(x)) +} +func (x *IMMessageIdE) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(IMMessageIdE_value, data, "IMMessageIdE") + if err != nil { + return err + } + *x = IMMessageIdE(value) + return nil +} +func (IMMessageIdE) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func init() { + proto.RegisterEnum("im.IMMessageIdE", IMMessageIdE_name, IMMessageIdE_value) +} + +func init() { proto.RegisterFile("im_msgid.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 96 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xcb, 0xcc, 0x8d, 0xcf, + 0x2d, 0x4e, 0xcf, 0x4c, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0xca, 0xcc, 0xd5, 0xb2, + 0xe3, 0xe2, 0xf5, 0xf4, 0xf5, 0x4d, 0x2d, 0x2e, 0x4e, 0x4c, 0x4f, 0xf5, 0x4c, 0x89, 0x4f, 0x15, + 0x12, 0xe1, 0x12, 0x88, 0xf7, 0xf4, 0x0d, 0xce, 0x4f, 0xce, 0x4e, 0x2d, 0x71, 0xce, 0xcf, 0xcb, + 0x4b, 0x4d, 0x2e, 0x11, 0x60, 0x14, 0x12, 0xe7, 0x12, 0x86, 0x8b, 0xba, 0x64, 0x16, 0x27, 0x43, + 0x25, 0x98, 0x00, 0x01, 0x00, 0x00, 0xff, 0xff, 0x15, 0xd2, 0xef, 0x38, 0x54, 0x00, 0x00, 0x00, +} diff --git a/im/im_msgid.proto b/im/im_msgid.proto new file mode 100644 index 0000000..24f0f4e --- /dev/null +++ b/im/im_msgid.proto @@ -0,0 +1,8 @@ +package im; + +//消息id定义 +enum IMMessageId_e +{ + _IMSocketConnect = 1; + _IMSocketDisconnect = 2; +} diff --git a/im/im_proto.pb.go b/im/im_proto.pb.go new file mode 100644 index 0000000..d9a5de8 --- /dev/null +++ b/im/im_proto.pb.go @@ -0,0 +1,119 @@ +// Code generated by protoc-gen-go. +// source: im_proto.proto +// DO NOT EDIT! + +package im + +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 + +// 常量 +type ConstantE int32 + +const ( + ConstantE_MaxIMMsgId ConstantE = 7 +) + +var ConstantE_name = map[int32]string{ + 7: "MaxIMMsgId", +} +var ConstantE_value = map[string]int32{ + "MaxIMMsgId": 7, +} + +func (x ConstantE) Enum() *ConstantE { + p := new(ConstantE) + *p = x + return p +} +func (x ConstantE) String() string { + return proto.EnumName(ConstantE_name, int32(x)) +} +func (x *ConstantE) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(ConstantE_value, data, "ConstantE") + if err != nil { + return err + } + *x = ConstantE(value) + return nil +} +func (ConstantE) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +type IMSocketConnect struct { + IsWebsocket *bool `protobuf:"varint,1,opt,name=is_websocket" json:"is_websocket,omitempty"` + Host *string `protobuf:"bytes,2,opt,name=host" json:"host,omitempty"` + Url *string `protobuf:"bytes,3,opt,name=url" json:"url,omitempty"` + QueryStr *string `protobuf:"bytes,4,opt,name=query_str" json:"query_str,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *IMSocketConnect) Reset() { *m = IMSocketConnect{} } +func (m *IMSocketConnect) String() string { return proto.CompactTextString(m) } +func (*IMSocketConnect) ProtoMessage() {} +func (*IMSocketConnect) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *IMSocketConnect) GetIsWebsocket() bool { + if m != nil && m.IsWebsocket != nil { + return *m.IsWebsocket + } + return false +} + +func (m *IMSocketConnect) GetHost() string { + if m != nil && m.Host != nil { + return *m.Host + } + return "" +} + +func (m *IMSocketConnect) GetUrl() string { + if m != nil && m.Url != nil { + return *m.Url + } + return "" +} + +func (m *IMSocketConnect) GetQueryStr() string { + if m != nil && m.QueryStr != nil { + return *m.QueryStr + } + return "" +} + +type IMSocketDisconnect struct { + XXX_unrecognized []byte `json:"-"` +} + +func (m *IMSocketDisconnect) Reset() { *m = IMSocketDisconnect{} } +func (m *IMSocketDisconnect) String() string { return proto.CompactTextString(m) } +func (*IMSocketDisconnect) ProtoMessage() {} +func (*IMSocketDisconnect) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func init() { + proto.RegisterType((*IMSocketConnect)(nil), "im.IMSocketConnect") + proto.RegisterType((*IMSocketDisconnect)(nil), "im.IMSocketDisconnect") + proto.RegisterEnum("im.ConstantE", ConstantE_name, ConstantE_value) +} + +func init() { proto.RegisterFile("im_proto.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 161 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xcb, 0xcc, 0x8d, 0x2f, + 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x03, 0x93, 0x42, 0x4c, 0x99, 0xb9, 0x4a, 0xa1, 0x5c, 0xfc, 0x9e, + 0xbe, 0xc1, 0xf9, 0xc9, 0xd9, 0xa9, 0x25, 0xce, 0xf9, 0x79, 0x79, 0xa9, 0xc9, 0x25, 0x42, 0x22, + 0x5c, 0x3c, 0x99, 0xc5, 0xf1, 0xe5, 0xa9, 0x49, 0xc5, 0x60, 0x61, 0x09, 0x46, 0x05, 0x46, 0x0d, + 0x0e, 0x21, 0x1e, 0x2e, 0x96, 0x8c, 0xfc, 0xe2, 0x12, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x4e, 0x21, + 0x6e, 0x2e, 0xe6, 0xd2, 0xa2, 0x1c, 0x09, 0x66, 0x30, 0x47, 0x90, 0x8b, 0xb3, 0xb0, 0x34, 0xb5, + 0xa8, 0x32, 0xbe, 0xb8, 0xa4, 0x48, 0x82, 0x05, 0x24, 0xa4, 0x24, 0xc2, 0x25, 0x04, 0x33, 0xd6, + 0x25, 0xb3, 0x38, 0x19, 0x62, 0xb2, 0x96, 0x0c, 0x17, 0x97, 0x73, 0x7e, 0x5e, 0x71, 0x49, 0x62, + 0x5e, 0x49, 0x7c, 0xaa, 0x10, 0x1f, 0x17, 0x97, 0x6f, 0x62, 0x85, 0xa7, 0xaf, 0x6f, 0x71, 0xba, + 0x67, 0x8a, 0x00, 0x3b, 0x20, 0x00, 0x00, 0xff, 0xff, 0x62, 0x1d, 0x43, 0x64, 0x9f, 0x00, 0x00, + 0x00, +} diff --git a/im/im_proto.proto b/im/im_proto.proto new file mode 100644 index 0000000..7734b8d --- /dev/null +++ b/im/im_proto.proto @@ -0,0 +1,20 @@ +package im; + +//常量 +enum Constant_e +{ + MaxIMMsgId = 7; +} + +message IMSocketConnect +{ + optional bool is_websocket = 1; + optional string host = 2; + optional string url = 3; + optional string query_str = 4; +} + +message IMSocketDisconnect +{ + +}