From 36c980b049fce538dcc33dad2221940937c955fc Mon Sep 17 00:00:00 2001 From: cloudwebrtc Date: Thu, 11 Mar 2021 20:48:40 +0800 Subject: [PATCH] improve. --- go.mod | 2 + go.sum | 6 + pkg/grpc/avp/avp.pb.go | 68 ++-- pkg/grpc/biz/biz.pb.go | 148 ++++----- pkg/grpc/ion/ion.pb.go | 582 ++++++++++++++++------------------ pkg/grpc/islb/islb.pb.go | 201 +++++++----- pkg/grpc/islb/islb_grpc.pb.go | 58 ++-- pkg/ion/node.go | 51 ++- pkg/ion/node_test.go | 57 +++- pkg/node/avp/avp.go | 4 +- pkg/node/biz/biz.go | 6 +- pkg/node/biz/biz_test.go | 28 +- pkg/node/biz/room.go | 36 ++- pkg/node/biz/server.go | 66 +--- pkg/node/biz/sfu.go | 2 +- pkg/node/islb/islb.go | 6 +- pkg/node/islb/server.go | 153 ++------- pkg/node/sfu/server.go | 80 +++-- pkg/node/sfu/sfu.go | 6 +- pkg/util/sdp.go | 80 +++++ protos/avp.proto | 2 +- protos/biz.proto | 6 +- protos/ion.proto | 60 ++-- protos/islb.proto | 13 +- 24 files changed, 886 insertions(+), 835 deletions(-) create mode 100644 pkg/util/sdp.go diff --git a/go.mod b/go.mod index d3d8f91c6..4c01acf15 100644 --- a/go.mod +++ b/go.mod @@ -12,10 +12,12 @@ require ( github.com/improbable-eng/grpc-web v0.13.0 github.com/nats-io/nats-server/v2 v2.1.9 github.com/nats-io/nats.go v1.10.0 + github.com/notedit/sdp v0.0.4 github.com/pion/ion-avp v1.8.1 github.com/pion/ion-log v1.0.0 github.com/pion/ion-sfu v1.9.3 github.com/pion/webrtc/v3 v3.0.10 + github.com/pixelbender/go-sdp v1.1.0 github.com/soheilhy/cmux v0.1.4 github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.7.1 diff --git a/go.sum b/go.sum index a35f9b1f5..1d3706357 100644 --- a/go.sum +++ b/go.sum @@ -14,6 +14,8 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Jeffail/gabs v1.1.1 h1:V0uzR08Hj22EX8+8QMhyI9sX2hwRu+/RJhJUmnwda/E= +github.com/Jeffail/gabs v1.1.1/go.mod h1:6xMvQMK4k33lb7GUUpaAPh6nKMmemQeg5d4gn7/bOXc= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= @@ -270,6 +272,8 @@ github.com/nats-io/nkeys v0.1.4 h1:aEsHIssIk6ETN5m2/MD8Y4B2X7FfXrBAUdkyRvbVYzA= github.com/nats-io/nkeys v0.1.4/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/notedit/sdp v0.0.4 h1:P4L8HbZ8SfzrRDE2m3zPnkHhcSdr/0sZkapKo0lyDJs= +github.com/notedit/sdp v0.0.4/go.mod h1:v7SdJxYpW6sY8RhA2KX14mmIHXKC0Kl/XrEQwaQJ7lM= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= @@ -355,6 +359,8 @@ github.com/pion/udp v0.1.0/go.mod h1:BPELIjbwE9PRbd/zxI/KYBnbo7B6+oA6YuEaNE8lths github.com/pion/webrtc/v3 v3.0.4/go.mod h1:1TmFSLpPYFTFXFHPtoq9eGP1ASTa9LC6FBh7sUY8cd4= github.com/pion/webrtc/v3 v3.0.10 h1:hti6k0DeN4tbQmAZiA8v6OvdkANQGw+R3nyqk9+dnz0= github.com/pion/webrtc/v3 v3.0.10/go.mod h1:KdEZWLmBnxB2Qj4FtUb9vi1sIpqsHOisI7L6ggQBD0A= +github.com/pixelbender/go-sdp v1.1.0 h1:rkm9aFBNKrnB+YGfhLmAkal3pC8XYXb9h+172PlrCBU= +github.com/pixelbender/go-sdp v1.1.0/go.mod h1:6IBlz9+BrUHoFTea7gcp4S54khtOhjCW/nVDLhmZBAs= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= diff --git a/pkg/grpc/avp/avp.pb.go b/pkg/grpc/avp/avp.pb.go index 4c2484d45..114e3fa68 100644 --- a/pkg/grpc/avp/avp.pb.go +++ b/pkg/grpc/avp/avp.pb.go @@ -227,7 +227,7 @@ type Element struct { // webmsaver/mixer/opencv/play/record/ml Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // params for element. - Parameters []*ion.Parameter `protobuf:"bytes,2,rep,name=parameters,proto3" json:"parameters,omitempty"` + Params map[string]string `protobuf:"bytes,2,rep,name=params,proto3" json:"params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *Element) Reset() { @@ -269,9 +269,9 @@ func (x *Element) GetName() string { return "" } -func (x *Element) GetParameters() []*ion.Parameter { +func (x *Element) GetParams() map[string]string { if x != nil { - return x.Parameters + return x.Params } return nil } @@ -426,31 +426,35 @@ var file_protos_avp_proto_rawDesc = []byte{ 0x10, 0x0a, 0x03, 0x74, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x4d, 0x0a, 0x07, 0x45, - 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x0a, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, - 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x0a, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x22, 0x81, 0x01, 0x0a, 0x0a, 0x41, - 0x56, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6e, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x73, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x69, 0x64, 0x12, 0x25, 0x0a, - 0x07, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, - 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x07, 0x73, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x73, 0x12, 0x28, 0x0a, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x61, 0x76, 0x70, 0x2e, 0x45, 0x6c, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x3a, - 0x0a, 0x08, 0x41, 0x56, 0x50, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x32, 0x3b, 0x0a, 0x03, 0x41, 0x56, - 0x50, 0x12, 0x34, 0x0a, 0x06, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x12, 0x12, 0x2e, 0x61, 0x76, - 0x70, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x10, 0x2e, 0x61, 0x76, 0x70, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6c, - 0x79, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x69, 0x6f, 0x6e, 0x2f, 0x69, 0x6f, 0x6e, 0x2f, 0x70, - 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x61, 0x76, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x01, 0x28, 0x0c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x8a, 0x01, 0x0a, 0x07, + 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x76, + 0x70, 0x2e, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x39, 0x0a, + 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x81, 0x01, 0x0a, 0x0a, 0x41, 0x56, 0x50, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6e, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x07, 0x73, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x69, + 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x07, 0x73, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x73, 0x12, 0x28, 0x0a, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x61, 0x76, 0x70, 0x2e, 0x45, 0x6c, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x3a, 0x0a, 0x08, + 0x41, 0x56, 0x50, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x32, 0x3b, 0x0a, 0x03, 0x41, 0x56, 0x50, 0x12, + 0x34, 0x0a, 0x06, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x12, 0x12, 0x2e, 0x61, 0x76, 0x70, 0x2e, + 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, + 0x61, 0x76, 0x70, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, + 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x69, 0x6f, 0x6e, 0x2f, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x6b, 0x67, + 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x61, 0x76, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -465,7 +469,7 @@ func file_protos_avp_proto_rawDescGZIP() []byte { return file_protos_avp_proto_rawDescData } -var file_protos_avp_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_protos_avp_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_protos_avp_proto_goTypes = []interface{}{ (*SignalRequest)(nil), // 0: avp.SignalRequest (*SignalReply)(nil), // 1: avp.SignalReply @@ -473,12 +477,12 @@ var file_protos_avp_proto_goTypes = []interface{}{ (*Element)(nil), // 3: avp.Element (*AVPRequest)(nil), // 4: avp.AVPRequest (*AVPReply)(nil), // 5: avp.AVPReply - (*ion.Parameter)(nil), // 6: ion.Parameter + nil, // 6: avp.Element.ParamsEntry (*ion.Stream)(nil), // 7: ion.Stream } var file_protos_avp_proto_depIdxs = []int32{ 2, // 0: avp.SignalRequest.process:type_name -> avp.Process - 6, // 1: avp.Element.parameters:type_name -> ion.Parameter + 6, // 1: avp.Element.params:type_name -> avp.Element.ParamsEntry 7, // 2: avp.AVPRequest.streams:type_name -> ion.Stream 3, // 3: avp.AVPRequest.elements:type_name -> avp.Element 0, // 4: avp.AVP.Signal:input_type -> avp.SignalRequest @@ -578,7 +582,7 @@ func file_protos_avp_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_protos_avp_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 7, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/grpc/biz/biz.pb.go b/pkg/grpc/biz/biz.pb.go index 887e7d031..e991b01c5 100644 --- a/pkg/grpc/biz/biz.pb.go +++ b/pkg/grpc/biz/biz.pb.go @@ -31,10 +31,8 @@ type Join struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"` - Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` - Info []byte `protobuf:"bytes,3,opt,name=info,proto3" json:"info,omitempty"` - Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` + Peer *ion.Peer `protobuf:"bytes,1,opt,name=peer,proto3" json:"peer,omitempty"` + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` } func (x *Join) Reset() { @@ -69,23 +67,9 @@ func (*Join) Descriptor() ([]byte, []int) { return file_protos_biz_proto_rawDescGZIP(), []int{0} } -func (x *Join) GetSid() string { +func (x *Join) GetPeer() *ion.Peer { if x != nil { - return x.Sid - } - return "" -} - -func (x *Join) GetUid() string { - if x != nil { - return x.Uid - } - return "" -} - -func (x *Join) GetInfo() []byte { - if x != nil { - return x.Info + return x.Peer } return nil } @@ -458,50 +442,48 @@ var File_protos_biz_proto protoreflect.FileDescriptor var file_protos_biz_proto_rawDesc = []byte{ 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x62, 0x69, 0x7a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x62, 0x69, 0x7a, 0x1a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, - 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x54, 0x0a, 0x04, 0x4a, 0x6f, 0x69, - 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x73, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, - 0x3d, 0x0a, 0x09, 0x4a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, - 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, - 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x19, - 0x0a, 0x05, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x0c, 0x0a, 0x0a, 0x4c, 0x65, 0x61, - 0x76, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x81, 0x01, 0x0a, 0x0d, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x04, 0x6a, 0x6f, 0x69, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x62, 0x69, 0x7a, 0x2e, 0x4a, 0x6f, - 0x69, 0x6e, 0x48, 0x00, 0x52, 0x04, 0x6a, 0x6f, 0x69, 0x6e, 0x12, 0x22, 0x0a, 0x05, 0x6c, 0x65, - 0x61, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x62, 0x69, 0x7a, 0x2e, - 0x4c, 0x65, 0x61, 0x76, 0x65, 0x48, 0x00, 0x52, 0x05, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x12, 0x20, - 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x69, 0x6f, - 0x6e, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x03, 0x6d, 0x73, 0x67, - 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x83, 0x02, 0x0a, 0x0b, - 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2e, 0x0a, 0x09, 0x6a, - 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, - 0x2e, 0x62, 0x69, 0x7a, 0x2e, 0x4a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x48, 0x00, - 0x52, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x31, 0x0a, 0x0a, 0x6c, - 0x65, 0x61, 0x76, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0f, 0x2e, 0x62, 0x69, 0x7a, 0x2e, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, - 0x48, 0x00, 0x52, 0x0a, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2e, - 0x0a, 0x09, 0x70, 0x65, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0e, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x48, 0x00, 0x52, 0x09, 0x70, 0x65, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x34, - 0x0a, 0x0b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0c, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, - 0x00, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x32, 0x39, 0x0a, 0x03, 0x42, 0x69, 0x7a, 0x12, 0x32, 0x0a, 0x06, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x6c, 0x12, 0x12, 0x2e, 0x62, 0x69, 0x7a, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x62, 0x69, 0x7a, 0x2e, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x28, 0x01, 0x30, 0x01, 0x42, 0x22, 0x5a, 0x20, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x69, 0x6f, 0x6e, 0x2f, - 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x62, 0x69, 0x7a, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3b, 0x0a, 0x04, 0x4a, 0x6f, 0x69, + 0x6e, 0x12, 0x1d, 0x0a, 0x04, 0x70, 0x65, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x09, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x52, 0x04, 0x70, 0x65, 0x65, 0x72, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x3d, 0x0a, 0x09, 0x4a, 0x6f, 0x69, 0x6e, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, + 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, + 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x19, 0x0a, 0x05, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, + 0x22, 0x0c, 0x0a, 0x0a, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x81, + 0x01, 0x0a, 0x0d, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1f, 0x0a, 0x04, 0x6a, 0x6f, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, + 0x2e, 0x62, 0x69, 0x7a, 0x2e, 0x4a, 0x6f, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x04, 0x6a, 0x6f, 0x69, + 0x6e, 0x12, 0x22, 0x0a, 0x05, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0a, 0x2e, 0x62, 0x69, 0x7a, 0x2e, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x48, 0x00, 0x52, 0x05, + 0x6c, 0x65, 0x61, 0x76, 0x65, 0x12, 0x20, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x48, 0x00, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x22, 0x83, 0x02, 0x0a, 0x0b, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x12, 0x2e, 0x0a, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x62, 0x69, 0x7a, 0x2e, 0x4a, 0x6f, 0x69, 0x6e, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x48, 0x00, 0x52, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x12, 0x31, 0x0a, 0x0a, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x62, 0x69, 0x7a, 0x2e, 0x4c, 0x65, 0x61, + 0x76, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x6c, 0x65, 0x61, 0x76, 0x65, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2e, 0x0a, 0x09, 0x70, 0x65, 0x65, 0x72, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x50, + 0x65, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x09, 0x70, 0x65, 0x65, 0x72, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x0b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x69, 0x6f, 0x6e, + 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0b, + 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x03, 0x6d, + 0x73, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x42, 0x09, 0x0a, + 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x32, 0x39, 0x0a, 0x03, 0x42, 0x69, 0x7a, 0x12, + 0x32, 0x0a, 0x06, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x12, 0x12, 0x2e, 0x62, 0x69, 0x7a, 0x2e, + 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, + 0x62, 0x69, 0x7a, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x28, + 0x01, 0x30, 0x01, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x69, 0x6f, 0x6e, 0x2f, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, + 0x72, 0x70, 0x63, 0x2f, 0x62, 0x69, 0x7a, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -524,26 +506,28 @@ var file_protos_biz_proto_goTypes = []interface{}{ (*LeaveReply)(nil), // 3: biz.LeaveReply (*SignalRequest)(nil), // 4: biz.SignalRequest (*SignalReply)(nil), // 5: biz.SignalReply - (*ion.Message)(nil), // 6: ion.Message - (*ion.PeerEvent)(nil), // 7: ion.PeerEvent - (*ion.StreamEvent)(nil), // 8: ion.StreamEvent + (*ion.Peer)(nil), // 6: ion.Peer + (*ion.Message)(nil), // 7: ion.Message + (*ion.PeerEvent)(nil), // 8: ion.PeerEvent + (*ion.StreamEvent)(nil), // 9: ion.StreamEvent } var file_protos_biz_proto_depIdxs = []int32{ - 0, // 0: biz.SignalRequest.join:type_name -> biz.Join - 2, // 1: biz.SignalRequest.leave:type_name -> biz.Leave - 6, // 2: biz.SignalRequest.msg:type_name -> ion.Message - 1, // 3: biz.SignalReply.joinReply:type_name -> biz.JoinReply - 3, // 4: biz.SignalReply.leaveReply:type_name -> biz.LeaveReply - 7, // 5: biz.SignalReply.peerEvent:type_name -> ion.PeerEvent - 8, // 6: biz.SignalReply.streamEvent:type_name -> ion.StreamEvent - 6, // 7: biz.SignalReply.msg:type_name -> ion.Message - 4, // 8: biz.Biz.Signal:input_type -> biz.SignalRequest - 5, // 9: biz.Biz.Signal:output_type -> biz.SignalReply - 9, // [9:10] is the sub-list for method output_type - 8, // [8:9] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 6, // 0: biz.Join.peer:type_name -> ion.Peer + 0, // 1: biz.SignalRequest.join:type_name -> biz.Join + 2, // 2: biz.SignalRequest.leave:type_name -> biz.Leave + 7, // 3: biz.SignalRequest.msg:type_name -> ion.Message + 1, // 4: biz.SignalReply.joinReply:type_name -> biz.JoinReply + 3, // 5: biz.SignalReply.leaveReply:type_name -> biz.LeaveReply + 8, // 6: biz.SignalReply.peerEvent:type_name -> ion.PeerEvent + 9, // 7: biz.SignalReply.streamEvent:type_name -> ion.StreamEvent + 7, // 8: biz.SignalReply.msg:type_name -> ion.Message + 4, // 9: biz.Biz.Signal:input_type -> biz.SignalRequest + 5, // 10: biz.Biz.Signal:output_type -> biz.SignalReply + 10, // [10:11] is the sub-list for method output_type + 9, // [9:10] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_protos_biz_proto_init() } diff --git a/pkg/grpc/ion/ion.pb.go b/pkg/grpc/ion/ion.pb.go index 0767dbcb5..aef6fc576 100644 --- a/pkg/grpc/ion/ion.pb.go +++ b/pkg/grpc/ion/ion.pb.go @@ -25,148 +25,145 @@ const ( // of the legacy proto package is being used. const _ = proto.ProtoPackageIsVersion4 -type SessionReport_State int32 +type SessionEvent_State int32 const ( - SessionReport_NEW SessionReport_State = 0 - SessionReport_UPDATE SessionReport_State = 1 - SessionReport_DELETE SessionReport_State = 2 + SessionEvent_NEW SessionEvent_State = 0 + SessionEvent_DELETE SessionEvent_State = 1 ) -// Enum value maps for SessionReport_State. +// Enum value maps for SessionEvent_State. var ( - SessionReport_State_name = map[int32]string{ + SessionEvent_State_name = map[int32]string{ 0: "NEW", - 1: "UPDATE", - 2: "DELETE", + 1: "DELETE", } - SessionReport_State_value = map[string]int32{ + SessionEvent_State_value = map[string]int32{ "NEW": 0, - "UPDATE": 1, - "DELETE": 2, + "DELETE": 1, } ) -func (x SessionReport_State) Enum() *SessionReport_State { - p := new(SessionReport_State) +func (x SessionEvent_State) Enum() *SessionEvent_State { + p := new(SessionEvent_State) *p = x return p } -func (x SessionReport_State) String() string { +func (x SessionEvent_State) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (SessionReport_State) Descriptor() protoreflect.EnumDescriptor { +func (SessionEvent_State) Descriptor() protoreflect.EnumDescriptor { return file_protos_ion_proto_enumTypes[0].Descriptor() } -func (SessionReport_State) Type() protoreflect.EnumType { +func (SessionEvent_State) Type() protoreflect.EnumType { return &file_protos_ion_proto_enumTypes[0] } -func (x SessionReport_State) Number() protoreflect.EnumNumber { +func (x SessionEvent_State) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// Deprecated: Use SessionReport_State.Descriptor instead. -func (SessionReport_State) EnumDescriptor() ([]byte, []int) { - return file_protos_ion_proto_rawDescGZIP(), []int{5, 0} +// Deprecated: Use SessionEvent_State.Descriptor instead. +func (SessionEvent_State) EnumDescriptor() ([]byte, []int) { + return file_protos_ion_proto_rawDescGZIP(), []int{4, 0} } -type PeerEvent_State int32 +type StreamEvent_State int32 const ( - PeerEvent_JOIN PeerEvent_State = 0 - PeerEvent_LEAVE PeerEvent_State = 1 + StreamEvent_NEW StreamEvent_State = 0 + StreamEvent_DELETE StreamEvent_State = 2 ) -// Enum value maps for PeerEvent_State. +// Enum value maps for StreamEvent_State. var ( - PeerEvent_State_name = map[int32]string{ - 0: "JOIN", - 1: "LEAVE", + StreamEvent_State_name = map[int32]string{ + 0: "NEW", + 2: "DELETE", } - PeerEvent_State_value = map[string]int32{ - "JOIN": 0, - "LEAVE": 1, + StreamEvent_State_value = map[string]int32{ + "NEW": 0, + "DELETE": 2, } ) -func (x PeerEvent_State) Enum() *PeerEvent_State { - p := new(PeerEvent_State) +func (x StreamEvent_State) Enum() *StreamEvent_State { + p := new(StreamEvent_State) *p = x return p } -func (x PeerEvent_State) String() string { +func (x StreamEvent_State) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (PeerEvent_State) Descriptor() protoreflect.EnumDescriptor { +func (StreamEvent_State) Descriptor() protoreflect.EnumDescriptor { return file_protos_ion_proto_enumTypes[1].Descriptor() } -func (PeerEvent_State) Type() protoreflect.EnumType { +func (StreamEvent_State) Type() protoreflect.EnumType { return &file_protos_ion_proto_enumTypes[1] } -func (x PeerEvent_State) Number() protoreflect.EnumNumber { +func (x StreamEvent_State) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// Deprecated: Use PeerEvent_State.Descriptor instead. -func (PeerEvent_State) EnumDescriptor() ([]byte, []int) { - return file_protos_ion_proto_rawDescGZIP(), []int{6, 0} +// Deprecated: Use StreamEvent_State.Descriptor instead. +func (StreamEvent_State) EnumDescriptor() ([]byte, []int) { + return file_protos_ion_proto_rawDescGZIP(), []int{5, 0} } -type StreamEvent_State int32 +type PeerEvent_State int32 const ( - StreamEvent_ADD StreamEvent_State = 0 - StreamEvent_UPDATE StreamEvent_State = 1 - StreamEvent_REMOVE StreamEvent_State = 2 + PeerEvent_JOIN PeerEvent_State = 0 + PeerEvent_UPDATE PeerEvent_State = 1 + PeerEvent_LEAVE PeerEvent_State = 2 ) -// Enum value maps for StreamEvent_State. +// Enum value maps for PeerEvent_State. var ( - StreamEvent_State_name = map[int32]string{ - 0: "ADD", + PeerEvent_State_name = map[int32]string{ + 0: "JOIN", 1: "UPDATE", - 2: "REMOVE", + 2: "LEAVE", } - StreamEvent_State_value = map[string]int32{ - "ADD": 0, + PeerEvent_State_value = map[string]int32{ + "JOIN": 0, "UPDATE": 1, - "REMOVE": 2, + "LEAVE": 2, } ) -func (x StreamEvent_State) Enum() *StreamEvent_State { - p := new(StreamEvent_State) +func (x PeerEvent_State) Enum() *PeerEvent_State { + p := new(PeerEvent_State) *p = x return p } -func (x StreamEvent_State) String() string { +func (x PeerEvent_State) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (StreamEvent_State) Descriptor() protoreflect.EnumDescriptor { +func (PeerEvent_State) Descriptor() protoreflect.EnumDescriptor { return file_protos_ion_proto_enumTypes[2].Descriptor() } -func (StreamEvent_State) Type() protoreflect.EnumType { +func (PeerEvent_State) Type() protoreflect.EnumType { return &file_protos_ion_proto_enumTypes[2] } -func (x StreamEvent_State) Number() protoreflect.EnumNumber { +func (x PeerEvent_State) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// Deprecated: Use StreamEvent_State.Descriptor instead. -func (StreamEvent_State) EnumDescriptor() ([]byte, []int) { - return file_protos_ion_proto_rawDescGZIP(), []int{7, 0} +// Deprecated: Use PeerEvent_State.Descriptor instead. +func (PeerEvent_State) EnumDescriptor() ([]byte, []int) { + return file_protos_ion_proto_rawDescGZIP(), []int{6, 0} } type Empty struct { @@ -212,11 +209,10 @@ type Track struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` - Rid string `protobuf:"bytes,3,opt,name=rid,proto3" json:"rid,omitempty"` - Ssrc uint32 `protobuf:"varint,4,opt,name=ssrc,proto3" json:"ssrc,omitempty"` - Codec string `protobuf:"bytes,5,opt,name=codec,proto3" json:"codec,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"` + Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` + Simulcast map[string]string `protobuf:"bytes,4,rep,name=simulcast,proto3" json:"simulcast,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *Track) Reset() { @@ -258,32 +254,25 @@ func (x *Track) GetId() string { return "" } -func (x *Track) GetKind() string { +func (x *Track) GetLabel() string { if x != nil { - return x.Kind + return x.Label } return "" } -func (x *Track) GetRid() string { +func (x *Track) GetKind() string { if x != nil { - return x.Rid + return x.Kind } return "" } -func (x *Track) GetSsrc() uint32 { +func (x *Track) GetSimulcast() map[string]string { if x != nil { - return x.Ssrc + return x.Simulcast } - return 0 -} - -func (x *Track) GetCodec() string { - if x != nil { - return x.Codec - } - return "" + return nil } type Stream struct { @@ -346,8 +335,9 @@ type Peer struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - Streams []*Stream `protobuf:"bytes,2,rep,name=streams,proto3" json:"streams,omitempty"` + Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"` + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` + Info []byte `protobuf:"bytes,3,opt,name=info,proto3" json:"info,omitempty"` } func (x *Peer) Reset() { @@ -382,6 +372,13 @@ func (*Peer) Descriptor() ([]byte, []int) { return file_protos_ion_proto_rawDescGZIP(), []int{3} } +func (x *Peer) GetSid() string { + if x != nil { + return x.Sid + } + return "" +} + func (x *Peer) GetUid() string { if x != nil { return x.Uid @@ -389,25 +386,25 @@ func (x *Peer) GetUid() string { return "" } -func (x *Peer) GetStreams() []*Stream { +func (x *Peer) GetInfo() []byte { if x != nil { - return x.Streams + return x.Info } return nil } -type Session struct { +type SessionEvent struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` - Sid string `protobuf:"bytes,3,opt,name=sid,proto3" json:"sid,omitempty"` - Peers []*Peer `protobuf:"bytes,4,rep,name=peers,proto3" json:"peers,omitempty"` + State SessionEvent_State `protobuf:"varint,2,opt,name=state,proto3,enum=ion.SessionEvent_State" json:"state,omitempty"` + Nid string `protobuf:"bytes,3,opt,name=nid,proto3" json:"nid,omitempty"` + Sid string `protobuf:"bytes,4,opt,name=sid,proto3" json:"sid,omitempty"` } -func (x *Session) Reset() { - *x = Session{} +func (x *SessionEvent) Reset() { + *x = SessionEvent{} if protoimpl.UnsafeEnabled { mi := &file_protos_ion_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -415,13 +412,13 @@ func (x *Session) Reset() { } } -func (x *Session) String() string { +func (x *SessionEvent) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Session) ProtoMessage() {} +func (*SessionEvent) ProtoMessage() {} -func (x *Session) ProtoReflect() protoreflect.Message { +func (x *SessionEvent) ProtoReflect() protoreflect.Message { mi := &file_protos_ion_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -433,43 +430,46 @@ func (x *Session) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Session.ProtoReflect.Descriptor instead. -func (*Session) Descriptor() ([]byte, []int) { +// Deprecated: Use SessionEvent.ProtoReflect.Descriptor instead. +func (*SessionEvent) Descriptor() ([]byte, []int) { return file_protos_ion_proto_rawDescGZIP(), []int{4} } -func (x *Session) GetNode() *Node { +func (x *SessionEvent) GetState() SessionEvent_State { if x != nil { - return x.Node + return x.State } - return nil + return SessionEvent_NEW } -func (x *Session) GetSid() string { +func (x *SessionEvent) GetNid() string { if x != nil { - return x.Sid + return x.Nid } return "" } -func (x *Session) GetPeers() []*Peer { +func (x *SessionEvent) GetSid() string { if x != nil { - return x.Peers + return x.Sid } - return nil + return "" } -type SessionReport struct { +type StreamEvent struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - State SessionReport_State `protobuf:"varint,3,opt,name=state,proto3,enum=ion.SessionReport_State" json:"state,omitempty"` - Session *Session `protobuf:"bytes,4,opt,name=session,proto3" json:"session,omitempty"` + State StreamEvent_State `protobuf:"varint,3,opt,name=state,proto3,enum=ion.StreamEvent_State" json:"state,omitempty"` + Nid string `protobuf:"bytes,4,opt,name=nid,proto3" json:"nid,omitempty"` + Sid string `protobuf:"bytes,5,opt,name=sid,proto3" json:"sid,omitempty"` + Uid string `protobuf:"bytes,6,opt,name=uid,proto3" json:"uid,omitempty"` + Streams []*Stream `protobuf:"bytes,7,rep,name=streams,proto3" json:"streams,omitempty"` } -func (x *SessionReport) Reset() { - *x = SessionReport{} +func (x *StreamEvent) Reset() { + *x = StreamEvent{} if protoimpl.UnsafeEnabled { mi := &file_protos_ion_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -477,13 +477,13 @@ func (x *SessionReport) Reset() { } } -func (x *SessionReport) String() string { +func (x *StreamEvent) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SessionReport) ProtoMessage() {} +func (*StreamEvent) ProtoMessage() {} -func (x *SessionReport) ProtoReflect() protoreflect.Message { +func (x *StreamEvent) ProtoReflect() protoreflect.Message { mi := &file_protos_ion_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -495,21 +495,42 @@ func (x *SessionReport) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SessionReport.ProtoReflect.Descriptor instead. -func (*SessionReport) Descriptor() ([]byte, []int) { +// Deprecated: Use StreamEvent.ProtoReflect.Descriptor instead. +func (*StreamEvent) Descriptor() ([]byte, []int) { return file_protos_ion_proto_rawDescGZIP(), []int{5} } -func (x *SessionReport) GetState() SessionReport_State { +func (x *StreamEvent) GetState() StreamEvent_State { if x != nil { return x.State } - return SessionReport_NEW + return StreamEvent_NEW +} + +func (x *StreamEvent) GetNid() string { + if x != nil { + return x.Nid + } + return "" +} + +func (x *StreamEvent) GetSid() string { + if x != nil { + return x.Sid + } + return "" +} + +func (x *StreamEvent) GetUid() string { + if x != nil { + return x.Uid + } + return "" } -func (x *SessionReport) GetSession() *Session { +func (x *StreamEvent) GetStreams() []*Stream { if x != nil { - return x.Session + return x.Streams } return nil } @@ -519,8 +540,8 @@ type PeerEvent struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - State PeerEvent_State `protobuf:"varint,2,opt,name=state,proto3,enum=ion.PeerEvent_State" json:"state,omitempty"` - Peer *Peer `protobuf:"bytes,3,opt,name=peer,proto3" json:"peer,omitempty"` + State PeerEvent_State `protobuf:"varint,3,opt,name=state,proto3,enum=ion.PeerEvent_State" json:"state,omitempty"` + Peer *Peer `protobuf:"bytes,4,opt,name=peer,proto3" json:"peer,omitempty"` } func (x *PeerEvent) Reset() { @@ -569,69 +590,6 @@ func (x *PeerEvent) GetPeer() *Peer { return nil } -type StreamEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Uid string `protobuf:"bytes,3,opt,name=uid,proto3" json:"uid,omitempty"` - State StreamEvent_State `protobuf:"varint,4,opt,name=state,proto3,enum=ion.StreamEvent_State" json:"state,omitempty"` - Streams []*Stream `protobuf:"bytes,5,rep,name=streams,proto3" json:"streams,omitempty"` -} - -func (x *StreamEvent) Reset() { - *x = StreamEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_protos_ion_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StreamEvent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StreamEvent) ProtoMessage() {} - -func (x *StreamEvent) ProtoReflect() protoreflect.Message { - mi := &file_protos_ion_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StreamEvent.ProtoReflect.Descriptor instead. -func (*StreamEvent) Descriptor() ([]byte, []int) { - return file_protos_ion_proto_rawDescGZIP(), []int{7} -} - -func (x *StreamEvent) GetUid() string { - if x != nil { - return x.Uid - } - return "" -} - -func (x *StreamEvent) GetState() StreamEvent_State { - if x != nil { - return x.State - } - return StreamEvent_ADD -} - -func (x *StreamEvent) GetStreams() []*Stream { - if x != nil { - return x.Streams - } - return nil -} - type Message struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -645,7 +603,7 @@ type Message struct { func (x *Message) Reset() { *x = Message{} if protoimpl.UnsafeEnabled { - mi := &file_protos_ion_proto_msgTypes[8] + mi := &file_protos_ion_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -658,7 +616,7 @@ func (x *Message) String() string { func (*Message) ProtoMessage() {} func (x *Message) ProtoReflect() protoreflect.Message { - mi := &file_protos_ion_proto_msgTypes[8] + mi := &file_protos_ion_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -671,7 +629,7 @@ func (x *Message) ProtoReflect() protoreflect.Message { // Deprecated: Use Message.ProtoReflect.Descriptor instead. func (*Message) Descriptor() ([]byte, []int) { - return file_protos_ion_proto_rawDescGZIP(), []int{8} + return file_protos_ion_proto_rawDescGZIP(), []int{7} } func (x *Message) GetFrom() string { @@ -707,7 +665,7 @@ type Parameter struct { func (x *Parameter) Reset() { *x = Parameter{} if protoimpl.UnsafeEnabled { - mi := &file_protos_ion_proto_msgTypes[9] + mi := &file_protos_ion_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -720,7 +678,7 @@ func (x *Parameter) String() string { func (*Parameter) ProtoMessage() {} func (x *Parameter) ProtoReflect() protoreflect.Message { - mi := &file_protos_ion_proto_msgTypes[9] + mi := &file_protos_ion_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -733,7 +691,7 @@ func (x *Parameter) ProtoReflect() protoreflect.Message { // Deprecated: Use Parameter.ProtoReflect.Descriptor instead. func (*Parameter) Descriptor() ([]byte, []int) { - return file_protos_ion_proto_rawDescGZIP(), []int{9} + return file_protos_ion_proto_rawDescGZIP(), []int{8} } func (x *Parameter) GetKey() string { @@ -755,15 +713,15 @@ type RPC struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Protocol string `protobuf:"bytes,1,opt,name=protocol,proto3" json:"protocol,omitempty"` - Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` - Params []*Parameter `protobuf:"bytes,3,rep,name=params,proto3" json:"params,omitempty"` + Protocol string `protobuf:"bytes,1,opt,name=protocol,proto3" json:"protocol,omitempty"` + Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` + Params map[string]string `protobuf:"bytes,3,rep,name=params,proto3" json:"params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *RPC) Reset() { *x = RPC{} if protoimpl.UnsafeEnabled { - mi := &file_protos_ion_proto_msgTypes[10] + mi := &file_protos_ion_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -776,7 +734,7 @@ func (x *RPC) String() string { func (*RPC) ProtoMessage() {} func (x *RPC) ProtoReflect() protoreflect.Message { - mi := &file_protos_ion_proto_msgTypes[10] + mi := &file_protos_ion_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -789,7 +747,7 @@ func (x *RPC) ProtoReflect() protoreflect.Message { // Deprecated: Use RPC.ProtoReflect.Descriptor instead. func (*RPC) Descriptor() ([]byte, []int) { - return file_protos_ion_proto_rawDescGZIP(), []int{10} + return file_protos_ion_proto_rawDescGZIP(), []int{9} } func (x *RPC) GetProtocol() string { @@ -806,7 +764,7 @@ func (x *RPC) GetAddr() string { return "" } -func (x *RPC) GetParams() []*Parameter { +func (x *RPC) GetParams() map[string]string { if x != nil { return x.Params } @@ -827,7 +785,7 @@ type Node struct { func (x *Node) Reset() { *x = Node{} if protoimpl.UnsafeEnabled { - mi := &file_protos_ion_proto_msgTypes[11] + mi := &file_protos_ion_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -840,7 +798,7 @@ func (x *Node) String() string { func (*Node) ProtoMessage() {} func (x *Node) ProtoReflect() protoreflect.Message { - mi := &file_protos_ion_proto_msgTypes[11] + mi := &file_protos_ion_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -853,7 +811,7 @@ func (x *Node) ProtoReflect() protoreflect.Message { // Deprecated: Use Node.ProtoReflect.Descriptor instead. func (*Node) Descriptor() ([]byte, []int) { - return file_protos_ion_proto_rawDescGZIP(), []int{11} + return file_protos_ion_proto_rawDescGZIP(), []int{10} } func (x *Node) GetDc() string { @@ -889,76 +847,80 @@ var File_protos_ion_proto protoreflect.FileDescriptor var file_protos_ion_proto_rawDesc = []byte{ 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x69, 0x6f, 0x6e, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x22, 0x67, 0x0a, 0x05, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x10, 0x0a, - 0x03, 0x72, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x69, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x73, 0x73, 0x72, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x73, - 0x73, 0x72, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x22, 0x3c, 0x0a, 0x06, 0x53, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x22, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x52, - 0x06, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x73, 0x22, 0x3f, 0x0a, 0x04, 0x50, 0x65, 0x65, 0x72, 0x12, - 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, - 0x64, 0x12, 0x25, 0x0a, 0x07, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, - 0x07, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x22, 0x5b, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x09, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, - 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x73, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x52, 0x05, - 0x70, 0x65, 0x65, 0x72, 0x73, 0x22, 0x91, 0x01, 0x0a, 0x0d, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x2e, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x26, 0x0a, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x53, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, - 0x28, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x4e, 0x45, 0x57, 0x10, - 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, - 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x02, 0x22, 0x74, 0x0a, 0x09, 0x50, 0x65, 0x65, - 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x65, 0x72, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x04, 0x70, 0x65, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x09, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x52, 0x04, 0x70, 0x65, 0x65, - 0x72, 0x22, 0x1c, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x4a, 0x4f, - 0x49, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x4c, 0x45, 0x41, 0x56, 0x45, 0x10, 0x01, 0x22, - 0x9e, 0x01, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, - 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, - 0x64, 0x12, 0x2c, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x16, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, - 0x25, 0x0a, 0x07, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0b, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x07, 0x73, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x22, 0x28, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, - 0x07, 0x0a, 0x03, 0x41, 0x44, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x50, 0x44, 0x41, - 0x54, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x10, 0x02, - 0x22, 0x41, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, - 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, - 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, - 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x22, 0x33, 0x0a, 0x09, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x5d, 0x0a, 0x03, 0x52, 0x50, 0x43, 0x12, - 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x61, - 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, - 0x26, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x0e, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, - 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x5e, 0x0a, 0x04, 0x4e, 0x6f, 0x64, 0x65, 0x12, - 0x0e, 0x0a, 0x02, 0x64, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x64, 0x63, 0x12, - 0x10, 0x0a, 0x03, 0x6e, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6e, 0x69, - 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x03, 0x72, - 0x70, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x52, - 0x50, 0x43, 0x52, 0x03, 0x72, 0x70, 0x63, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x69, 0x6f, 0x6e, 0x2f, 0x69, 0x6f, 0x6e, 0x2f, 0x70, - 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x22, 0xb8, 0x01, 0x0a, 0x05, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x63, 0x61, 0x73, + 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x72, + 0x61, 0x63, 0x6b, 0x2e, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x63, 0x61, 0x73, 0x74, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x09, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x63, 0x61, 0x73, 0x74, 0x1a, 0x3c, 0x0a, + 0x0e, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x63, 0x61, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x3c, 0x0a, 0x06, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x22, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x72, 0x61, 0x63, + 0x6b, 0x52, 0x06, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x73, 0x22, 0x3e, 0x0a, 0x04, 0x50, 0x65, 0x65, + 0x72, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x73, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x7f, 0x0a, 0x0c, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x2d, 0x0a, 0x05, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x53, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6e, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x69, 0x64, 0x22, 0x1c, 0x0a, 0x05, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x4e, 0x45, 0x57, 0x10, 0x00, 0x12, 0x0a, + 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x01, 0x22, 0xb6, 0x01, 0x0a, 0x0b, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x69, 0x64, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6e, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, + 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, + 0x75, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x25, + 0x0a, 0x07, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0b, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x07, 0x73, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x73, 0x22, 0x1c, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x07, + 0x0a, 0x03, 0x4e, 0x45, 0x57, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, + 0x45, 0x10, 0x02, 0x22, 0x80, 0x01, 0x0a, 0x09, 0x50, 0x65, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x12, 0x2a, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x14, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1d, 0x0a, + 0x04, 0x70, 0x65, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x69, 0x6f, + 0x6e, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x52, 0x04, 0x70, 0x65, 0x65, 0x72, 0x22, 0x28, 0x0a, 0x05, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x4a, 0x4f, 0x49, 0x4e, 0x10, 0x00, 0x12, + 0x0a, 0x0a, 0x06, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x4c, + 0x45, 0x41, 0x56, 0x45, 0x10, 0x02, 0x22, 0x41, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x33, 0x0a, 0x09, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x9e, + 0x01, 0x0a, 0x03, 0x52, 0x50, 0x43, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x2c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x50, 0x43, + 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0x5e, 0x0a, 0x04, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x63, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x64, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6e, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x03, 0x72, 0x70, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x08, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x50, 0x43, 0x52, 0x03, 0x72, 0x70, 0x63, 0x42, + 0x22, 0x5a, 0x20, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x69, + 0x6f, 0x6e, 0x2f, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, + 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -974,42 +936,40 @@ func file_protos_ion_proto_rawDescGZIP() []byte { } var file_protos_ion_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_protos_ion_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_protos_ion_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_protos_ion_proto_goTypes = []interface{}{ - (SessionReport_State)(0), // 0: ion.SessionReport.State - (PeerEvent_State)(0), // 1: ion.PeerEvent.State - (StreamEvent_State)(0), // 2: ion.StreamEvent.State - (*Empty)(nil), // 3: ion.Empty - (*Track)(nil), // 4: ion.Track - (*Stream)(nil), // 5: ion.Stream - (*Peer)(nil), // 6: ion.Peer - (*Session)(nil), // 7: ion.Session - (*SessionReport)(nil), // 8: ion.SessionReport - (*PeerEvent)(nil), // 9: ion.PeerEvent - (*StreamEvent)(nil), // 10: ion.StreamEvent - (*Message)(nil), // 11: ion.Message - (*Parameter)(nil), // 12: ion.Parameter - (*RPC)(nil), // 13: ion.RPC - (*Node)(nil), // 14: ion.Node + (SessionEvent_State)(0), // 0: ion.SessionEvent.State + (StreamEvent_State)(0), // 1: ion.StreamEvent.State + (PeerEvent_State)(0), // 2: ion.PeerEvent.State + (*Empty)(nil), // 3: ion.Empty + (*Track)(nil), // 4: ion.Track + (*Stream)(nil), // 5: ion.Stream + (*Peer)(nil), // 6: ion.Peer + (*SessionEvent)(nil), // 7: ion.SessionEvent + (*StreamEvent)(nil), // 8: ion.StreamEvent + (*PeerEvent)(nil), // 9: ion.PeerEvent + (*Message)(nil), // 10: ion.Message + (*Parameter)(nil), // 11: ion.Parameter + (*RPC)(nil), // 12: ion.RPC + (*Node)(nil), // 13: ion.Node + nil, // 14: ion.Track.SimulcastEntry + nil, // 15: ion.RPC.ParamsEntry } var file_protos_ion_proto_depIdxs = []int32{ - 4, // 0: ion.Stream.tracks:type_name -> ion.Track - 5, // 1: ion.Peer.streams:type_name -> ion.Stream - 14, // 2: ion.Session.node:type_name -> ion.Node - 6, // 3: ion.Session.peers:type_name -> ion.Peer - 0, // 4: ion.SessionReport.state:type_name -> ion.SessionReport.State - 7, // 5: ion.SessionReport.session:type_name -> ion.Session - 1, // 6: ion.PeerEvent.state:type_name -> ion.PeerEvent.State - 6, // 7: ion.PeerEvent.peer:type_name -> ion.Peer - 2, // 8: ion.StreamEvent.state:type_name -> ion.StreamEvent.State - 5, // 9: ion.StreamEvent.streams:type_name -> ion.Stream - 12, // 10: ion.RPC.params:type_name -> ion.Parameter - 13, // 11: ion.Node.rpc:type_name -> ion.RPC - 12, // [12:12] is the sub-list for method output_type - 12, // [12:12] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 14, // 0: ion.Track.simulcast:type_name -> ion.Track.SimulcastEntry + 4, // 1: ion.Stream.tracks:type_name -> ion.Track + 0, // 2: ion.SessionEvent.state:type_name -> ion.SessionEvent.State + 1, // 3: ion.StreamEvent.state:type_name -> ion.StreamEvent.State + 5, // 4: ion.StreamEvent.streams:type_name -> ion.Stream + 2, // 5: ion.PeerEvent.state:type_name -> ion.PeerEvent.State + 6, // 6: ion.PeerEvent.peer:type_name -> ion.Peer + 15, // 7: ion.RPC.params:type_name -> ion.RPC.ParamsEntry + 12, // 8: ion.Node.rpc:type_name -> ion.RPC + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_protos_ion_proto_init() } @@ -1067,7 +1027,7 @@ func file_protos_ion_proto_init() { } } file_protos_ion_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Session); i { + switch v := v.(*SessionEvent); i { case 0: return &v.state case 1: @@ -1079,7 +1039,7 @@ func file_protos_ion_proto_init() { } } file_protos_ion_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SessionReport); i { + switch v := v.(*StreamEvent); i { case 0: return &v.state case 1: @@ -1103,18 +1063,6 @@ func file_protos_ion_proto_init() { } } file_protos_ion_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StreamEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_protos_ion_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Message); i { case 0: return &v.state @@ -1126,7 +1074,7 @@ func file_protos_ion_proto_init() { return nil } } - file_protos_ion_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_protos_ion_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Parameter); i { case 0: return &v.state @@ -1138,7 +1086,7 @@ func file_protos_ion_proto_init() { return nil } } - file_protos_ion_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_protos_ion_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RPC); i { case 0: return &v.state @@ -1150,7 +1098,7 @@ func file_protos_ion_proto_init() { return nil } } - file_protos_ion_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_protos_ion_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Node); i { case 0: return &v.state @@ -1169,7 +1117,7 @@ func file_protos_ion_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_protos_ion_proto_rawDesc, NumEnums: 3, - NumMessages: 12, + NumMessages: 13, NumExtensions: 0, NumServices: 0, }, diff --git a/pkg/grpc/islb/islb.pb.go b/pkg/grpc/islb/islb.pb.go index a27f198ea..9f88fdbd3 100644 --- a/pkg/grpc/islb/islb.pb.go +++ b/pkg/grpc/islb/islb.pb.go @@ -136,22 +136,59 @@ func (x *FindNodeReply) GetNodes() []*ion.Node { return nil } +type WatchRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *WatchRequest) Reset() { + *x = WatchRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_protos_islb_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WatchRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WatchRequest) ProtoMessage() {} + +func (x *WatchRequest) ProtoReflect() protoreflect.Message { + mi := &file_protos_islb_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WatchRequest.ProtoReflect.Descriptor instead. +func (*WatchRequest) Descriptor() ([]byte, []int) { + return file_protos_islb_proto_rawDescGZIP(), []int{2} +} + type ISLBEvent struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Types that are assignable to Payload: - // *ISLBEvent_PeerEvent - // *ISLBEvent_StreamEvent - // *ISLBEvent_Msg + // *ISLBEvent_Session + // *ISLBEvent_Stream Payload isISLBEvent_Payload `protobuf_oneof:"payload"` } func (x *ISLBEvent) Reset() { *x = ISLBEvent{} if protoimpl.UnsafeEnabled { - mi := &file_protos_islb_proto_msgTypes[2] + mi := &file_protos_islb_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -164,7 +201,7 @@ func (x *ISLBEvent) String() string { func (*ISLBEvent) ProtoMessage() {} func (x *ISLBEvent) ProtoReflect() protoreflect.Message { - mi := &file_protos_islb_proto_msgTypes[2] + mi := &file_protos_islb_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -177,7 +214,7 @@ func (x *ISLBEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use ISLBEvent.ProtoReflect.Descriptor instead. func (*ISLBEvent) Descriptor() ([]byte, []int) { - return file_protos_islb_proto_rawDescGZIP(), []int{2} + return file_protos_islb_proto_rawDescGZIP(), []int{3} } func (m *ISLBEvent) GetPayload() isISLBEvent_Payload { @@ -187,23 +224,16 @@ func (m *ISLBEvent) GetPayload() isISLBEvent_Payload { return nil } -func (x *ISLBEvent) GetPeerEvent() *ion.PeerEvent { - if x, ok := x.GetPayload().(*ISLBEvent_PeerEvent); ok { - return x.PeerEvent - } - return nil -} - -func (x *ISLBEvent) GetStreamEvent() *ion.StreamEvent { - if x, ok := x.GetPayload().(*ISLBEvent_StreamEvent); ok { - return x.StreamEvent +func (x *ISLBEvent) GetSession() *ion.SessionEvent { + if x, ok := x.GetPayload().(*ISLBEvent_Session); ok { + return x.Session } return nil } -func (x *ISLBEvent) GetMsg() *ion.Message { - if x, ok := x.GetPayload().(*ISLBEvent_Msg); ok { - return x.Msg +func (x *ISLBEvent) GetStream() *ion.StreamEvent { + if x, ok := x.GetPayload().(*ISLBEvent_Stream); ok { + return x.Stream } return nil } @@ -212,23 +242,17 @@ type isISLBEvent_Payload interface { isISLBEvent_Payload() } -type ISLBEvent_PeerEvent struct { - PeerEvent *ion.PeerEvent `protobuf:"bytes,2,opt,name=peerEvent,proto3,oneof"` +type ISLBEvent_Session struct { + Session *ion.SessionEvent `protobuf:"bytes,1,opt,name=session,proto3,oneof"` } -type ISLBEvent_StreamEvent struct { - StreamEvent *ion.StreamEvent `protobuf:"bytes,3,opt,name=streamEvent,proto3,oneof"` +type ISLBEvent_Stream struct { + Stream *ion.StreamEvent `protobuf:"bytes,2,opt,name=stream,proto3,oneof"` } -type ISLBEvent_Msg struct { - Msg *ion.Message `protobuf:"bytes,4,opt,name=msg,proto3,oneof"` -} +func (*ISLBEvent_Session) isISLBEvent_Payload() {} -func (*ISLBEvent_PeerEvent) isISLBEvent_Payload() {} - -func (*ISLBEvent_StreamEvent) isISLBEvent_Payload() {} - -func (*ISLBEvent_Msg) isISLBEvent_Payload() {} +func (*ISLBEvent_Stream) isISLBEvent_Payload() {} var File_protos_islb_proto protoreflect.FileDescriptor @@ -243,30 +267,29 @@ var file_protos_islb_proto_rawDesc = []byte{ 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x30, 0x0a, 0x0d, 0x46, 0x69, 0x6e, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1f, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x69, - 0x6f, 0x6e, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x9e, - 0x01, 0x0a, 0x09, 0x49, 0x53, 0x4c, 0x42, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x09, - 0x70, 0x65, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0e, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, - 0x00, 0x52, 0x09, 0x70, 0x65, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x0b, - 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0c, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, - 0x03, 0x6d, 0x73, 0x67, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x32, - 0x9c, 0x01, 0x0a, 0x04, 0x49, 0x53, 0x4c, 0x42, 0x12, 0x38, 0x0a, 0x08, 0x46, 0x69, 0x6e, 0x64, - 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x15, 0x2e, 0x69, 0x73, 0x6c, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, - 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x69, 0x73, - 0x6c, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, - 0x22, 0x00, 0x12, 0x2a, 0x0a, 0x09, 0x50, 0x6f, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, - 0x0f, 0x2e, 0x69, 0x73, 0x6c, 0x62, 0x2e, 0x49, 0x53, 0x4c, 0x42, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x1a, 0x0a, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x2e, - 0x0a, 0x0b, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0a, 0x2e, - 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0f, 0x2e, 0x69, 0x73, 0x6c, 0x62, - 0x2e, 0x49, 0x53, 0x4c, 0x42, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x00, 0x30, 0x01, 0x42, 0x23, - 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x69, 0x6f, - 0x6e, 0x2f, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x69, - 0x73, 0x6c, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x6e, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x0e, + 0x0a, 0x0c, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x71, + 0x0a, 0x09, 0x49, 0x53, 0x4c, 0x42, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x69, + 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, + 0x00, 0x52, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x69, 0x6f, 0x6e, + 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x06, + 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x32, 0xa3, 0x01, 0x0a, 0x04, 0x49, 0x53, 0x4c, 0x42, 0x12, 0x38, 0x0a, 0x08, 0x46, 0x69, + 0x6e, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x15, 0x2e, 0x69, 0x73, 0x6c, 0x62, 0x2e, 0x46, 0x69, + 0x6e, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, + 0x69, 0x73, 0x6c, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x22, 0x00, 0x12, 0x2e, 0x0a, 0x0d, 0x50, 0x6f, 0x73, 0x74, 0x49, 0x53, 0x4c, 0x42, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0f, 0x2e, 0x69, 0x73, 0x6c, 0x62, 0x2e, 0x49, 0x53, 0x4c, + 0x42, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x0a, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x0e, 0x57, 0x61, 0x74, 0x63, 0x68, 0x49, 0x53, 0x4c, + 0x42, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0a, 0x2e, 0x69, 0x6f, 0x6e, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x1a, 0x0f, 0x2e, 0x69, 0x73, 0x6c, 0x62, 0x2e, 0x49, 0x53, 0x4c, 0x42, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x22, 0x00, 0x30, 0x01, 0x42, 0x23, 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x69, 0x6f, 0x6e, 0x2f, 0x69, 0x6f, 0x6e, 0x2f, 0x70, + 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x69, 0x73, 0x6c, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -281,33 +304,32 @@ func file_protos_islb_proto_rawDescGZIP() []byte { return file_protos_islb_proto_rawDescData } -var file_protos_islb_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_protos_islb_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_protos_islb_proto_goTypes = []interface{}{ - (*FindNodeRequest)(nil), // 0: islb.FindNodeRequest - (*FindNodeReply)(nil), // 1: islb.FindNodeReply - (*ISLBEvent)(nil), // 2: islb.ISLBEvent - (*ion.Node)(nil), // 3: ion.Node - (*ion.PeerEvent)(nil), // 4: ion.PeerEvent - (*ion.StreamEvent)(nil), // 5: ion.StreamEvent - (*ion.Message)(nil), // 6: ion.Message - (*ion.Empty)(nil), // 7: ion.Empty + (*FindNodeRequest)(nil), // 0: islb.FindNodeRequest + (*FindNodeReply)(nil), // 1: islb.FindNodeReply + (*WatchRequest)(nil), // 2: islb.WatchRequest + (*ISLBEvent)(nil), // 3: islb.ISLBEvent + (*ion.Node)(nil), // 4: ion.Node + (*ion.SessionEvent)(nil), // 5: ion.SessionEvent + (*ion.StreamEvent)(nil), // 6: ion.StreamEvent + (*ion.Empty)(nil), // 7: ion.Empty } var file_protos_islb_proto_depIdxs = []int32{ - 3, // 0: islb.FindNodeReply.nodes:type_name -> ion.Node - 4, // 1: islb.ISLBEvent.peerEvent:type_name -> ion.PeerEvent - 5, // 2: islb.ISLBEvent.streamEvent:type_name -> ion.StreamEvent - 6, // 3: islb.ISLBEvent.msg:type_name -> ion.Message - 0, // 4: islb.ISLB.FindNode:input_type -> islb.FindNodeRequest - 2, // 5: islb.ISLB.PostEvent:input_type -> islb.ISLBEvent - 7, // 6: islb.ISLB.HandleEvent:input_type -> ion.Empty - 1, // 7: islb.ISLB.FindNode:output_type -> islb.FindNodeReply - 7, // 8: islb.ISLB.PostEvent:output_type -> ion.Empty - 2, // 9: islb.ISLB.HandleEvent:output_type -> islb.ISLBEvent - 7, // [7:10] is the sub-list for method output_type - 4, // [4:7] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 4, // 0: islb.FindNodeReply.nodes:type_name -> ion.Node + 5, // 1: islb.ISLBEvent.session:type_name -> ion.SessionEvent + 6, // 2: islb.ISLBEvent.stream:type_name -> ion.StreamEvent + 0, // 3: islb.ISLB.FindNode:input_type -> islb.FindNodeRequest + 3, // 4: islb.ISLB.PostISLBEvent:input_type -> islb.ISLBEvent + 7, // 5: islb.ISLB.WatchISLBEvent:input_type -> ion.Empty + 1, // 6: islb.ISLB.FindNode:output_type -> islb.FindNodeReply + 7, // 7: islb.ISLB.PostISLBEvent:output_type -> ion.Empty + 3, // 8: islb.ISLB.WatchISLBEvent:output_type -> islb.ISLBEvent + 6, // [6:9] is the sub-list for method output_type + 3, // [3:6] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_protos_islb_proto_init() } @@ -341,6 +363,18 @@ func file_protos_islb_proto_init() { } } file_protos_islb_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WatchRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protos_islb_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ISLBEvent); i { case 0: return &v.state @@ -353,10 +387,9 @@ func file_protos_islb_proto_init() { } } } - file_protos_islb_proto_msgTypes[2].OneofWrappers = []interface{}{ - (*ISLBEvent_PeerEvent)(nil), - (*ISLBEvent_StreamEvent)(nil), - (*ISLBEvent_Msg)(nil), + file_protos_islb_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*ISLBEvent_Session)(nil), + (*ISLBEvent_Stream)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -364,7 +397,7 @@ func file_protos_islb_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_protos_islb_proto_rawDesc, NumEnums: 0, - NumMessages: 3, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/grpc/islb/islb_grpc.pb.go b/pkg/grpc/islb/islb_grpc.pb.go index efc1d46ba..4642c8fb2 100644 --- a/pkg/grpc/islb/islb_grpc.pb.go +++ b/pkg/grpc/islb/islb_grpc.pb.go @@ -20,8 +20,8 @@ const _ = grpc.SupportPackageIsVersion7 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type ISLBClient interface { FindNode(ctx context.Context, in *FindNodeRequest, opts ...grpc.CallOption) (*FindNodeReply, error) - PostEvent(ctx context.Context, in *ISLBEvent, opts ...grpc.CallOption) (*ion.Empty, error) - HandleEvent(ctx context.Context, in *ion.Empty, opts ...grpc.CallOption) (ISLB_HandleEventClient, error) + PostISLBEvent(ctx context.Context, in *ISLBEvent, opts ...grpc.CallOption) (*ion.Empty, error) + WatchISLBEvent(ctx context.Context, in *ion.Empty, opts ...grpc.CallOption) (ISLB_WatchISLBEventClient, error) } type iSLBClient struct { @@ -41,21 +41,21 @@ func (c *iSLBClient) FindNode(ctx context.Context, in *FindNodeRequest, opts ... return out, nil } -func (c *iSLBClient) PostEvent(ctx context.Context, in *ISLBEvent, opts ...grpc.CallOption) (*ion.Empty, error) { +func (c *iSLBClient) PostISLBEvent(ctx context.Context, in *ISLBEvent, opts ...grpc.CallOption) (*ion.Empty, error) { out := new(ion.Empty) - err := c.cc.Invoke(ctx, "/islb.ISLB/PostEvent", in, out, opts...) + err := c.cc.Invoke(ctx, "/islb.ISLB/PostISLBEvent", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *iSLBClient) HandleEvent(ctx context.Context, in *ion.Empty, opts ...grpc.CallOption) (ISLB_HandleEventClient, error) { - stream, err := c.cc.NewStream(ctx, &ISLB_ServiceDesc.Streams[0], "/islb.ISLB/HandleEvent", opts...) +func (c *iSLBClient) WatchISLBEvent(ctx context.Context, in *ion.Empty, opts ...grpc.CallOption) (ISLB_WatchISLBEventClient, error) { + stream, err := c.cc.NewStream(ctx, &ISLB_ServiceDesc.Streams[0], "/islb.ISLB/WatchISLBEvent", opts...) if err != nil { return nil, err } - x := &iSLBHandleEventClient{stream} + x := &iSLBWatchISLBEventClient{stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -65,16 +65,16 @@ func (c *iSLBClient) HandleEvent(ctx context.Context, in *ion.Empty, opts ...grp return x, nil } -type ISLB_HandleEventClient interface { +type ISLB_WatchISLBEventClient interface { Recv() (*ISLBEvent, error) grpc.ClientStream } -type iSLBHandleEventClient struct { +type iSLBWatchISLBEventClient struct { grpc.ClientStream } -func (x *iSLBHandleEventClient) Recv() (*ISLBEvent, error) { +func (x *iSLBWatchISLBEventClient) Recv() (*ISLBEvent, error) { m := new(ISLBEvent) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err @@ -87,8 +87,8 @@ func (x *iSLBHandleEventClient) Recv() (*ISLBEvent, error) { // for forward compatibility type ISLBServer interface { FindNode(context.Context, *FindNodeRequest) (*FindNodeReply, error) - PostEvent(context.Context, *ISLBEvent) (*ion.Empty, error) - HandleEvent(*ion.Empty, ISLB_HandleEventServer) error + PostISLBEvent(context.Context, *ISLBEvent) (*ion.Empty, error) + WatchISLBEvent(*ion.Empty, ISLB_WatchISLBEventServer) error mustEmbedUnimplementedISLBServer() } @@ -99,11 +99,11 @@ type UnimplementedISLBServer struct { func (UnimplementedISLBServer) FindNode(context.Context, *FindNodeRequest) (*FindNodeReply, error) { return nil, status.Errorf(codes.Unimplemented, "method FindNode not implemented") } -func (UnimplementedISLBServer) PostEvent(context.Context, *ISLBEvent) (*ion.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method PostEvent not implemented") +func (UnimplementedISLBServer) PostISLBEvent(context.Context, *ISLBEvent) (*ion.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method PostISLBEvent not implemented") } -func (UnimplementedISLBServer) HandleEvent(*ion.Empty, ISLB_HandleEventServer) error { - return status.Errorf(codes.Unimplemented, "method HandleEvent not implemented") +func (UnimplementedISLBServer) WatchISLBEvent(*ion.Empty, ISLB_WatchISLBEventServer) error { + return status.Errorf(codes.Unimplemented, "method WatchISLBEvent not implemented") } func (UnimplementedISLBServer) mustEmbedUnimplementedISLBServer() {} @@ -136,42 +136,42 @@ func _ISLB_FindNode_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -func _ISLB_PostEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ISLB_PostISLBEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ISLBEvent) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ISLBServer).PostEvent(ctx, in) + return srv.(ISLBServer).PostISLBEvent(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/islb.ISLB/PostEvent", + FullMethod: "/islb.ISLB/PostISLBEvent", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ISLBServer).PostEvent(ctx, req.(*ISLBEvent)) + return srv.(ISLBServer).PostISLBEvent(ctx, req.(*ISLBEvent)) } return interceptor(ctx, in, info, handler) } -func _ISLB_HandleEvent_Handler(srv interface{}, stream grpc.ServerStream) error { +func _ISLB_WatchISLBEvent_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(ion.Empty) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(ISLBServer).HandleEvent(m, &iSLBHandleEventServer{stream}) + return srv.(ISLBServer).WatchISLBEvent(m, &iSLBWatchISLBEventServer{stream}) } -type ISLB_HandleEventServer interface { +type ISLB_WatchISLBEventServer interface { Send(*ISLBEvent) error grpc.ServerStream } -type iSLBHandleEventServer struct { +type iSLBWatchISLBEventServer struct { grpc.ServerStream } -func (x *iSLBHandleEventServer) Send(m *ISLBEvent) error { +func (x *iSLBWatchISLBEventServer) Send(m *ISLBEvent) error { return x.ServerStream.SendMsg(m) } @@ -187,14 +187,14 @@ var ISLB_ServiceDesc = grpc.ServiceDesc{ Handler: _ISLB_FindNode_Handler, }, { - MethodName: "PostEvent", - Handler: _ISLB_PostEvent_Handler, + MethodName: "PostISLBEvent", + Handler: _ISLB_PostISLBEvent_Handler, }, }, Streams: []grpc.StreamDesc{ { - StreamName: "HandleEvent", - Handler: _ISLB_HandleEvent_Handler, + StreamName: "WatchISLBEvent", + Handler: _ISLB_WatchISLBEvent_Handler, ServerStreams: true, }, }, diff --git a/pkg/ion/node.go b/pkg/ion/node.go index bdd8015c1..d3a009440 100644 --- a/pkg/ion/node.go +++ b/pkg/ion/node.go @@ -1,6 +1,8 @@ package ion import ( + "sync" + nd "github.com/cloudwebrtc/nats-discovery/pkg/client" "github.com/cloudwebrtc/nats-discovery/pkg/discovery" "github.com/cloudwebrtc/nats-grpc/pkg/rpc" @@ -10,6 +12,7 @@ import ( "google.golang.org/grpc" ) +//Node . type Node struct { // Node ID NID string @@ -19,8 +22,21 @@ type Node struct { nrpc *rpc.Server // Service discovery client nd *nd.Client + + nodeLock sync.RWMutex + //neighbor nodes + neighborNodes map[string]*discovery.Node +} + +//NewNode . +func NewNode(nid string) Node { + return Node{ + NID: nid, + neighborNodes: make(map[string]*discovery.Node), + } } +//Start . func (n *Node) Start(natURL string) error { var err error n.nc, err = util.NewNatsConn(natURL) @@ -39,31 +55,60 @@ func (n *Node) Start(natURL string) error { return nil } +//NatsConn . func (n *Node) NatsConn() *nats.Conn { return n.nc } +//KeepAlive Upload your node info to registry. func (n *Node) KeepAlive(node discovery.Node) error { return n.nd.KeepAlive(node) } -func (n *Node) Watch(service string, onStateChange nd.NodeStateChangeCallback) error { +//Watch the neighbor nodes +func (n *Node) Watch(service string) error { resp, err := n.nd.Get(service) if err != nil { log.Errorf("Watch service %v error %v", service, err) return err } for _, node := range resp.Nodes { - onStateChange(discovery.NodeUp, &node) + n.handleNeighborNodes(discovery.NodeUp, &node) } - return n.nd.Watch(service, onStateChange) + return n.nd.Watch(service, n.handleNeighborNodes) +} + +// GetNeighborNodes get neighbor nodes. +func (n *Node) GetNeighborNodes() map[string]*discovery.Node { + n.nodeLock.Lock() + defer n.nodeLock.Unlock() + return n.neighborNodes +} + +// handleNeighborNodes handle nodes up/down +func (n *Node) handleNeighborNodes(state discovery.NodeState, node *discovery.Node) { + n.nodeLock.Lock() + defer n.nodeLock.Unlock() + id := node.NID + service := node.Service + if state == discovery.NodeUp { + log.Infof("Service up: "+service+" node id => [%v], rpc => %v", id, node.RPC.Protocol) + if _, found := n.neighborNodes[id]; !found { + n.neighborNodes[id] = node + } + } else if state == discovery.NodeDown { + log.Infof("Service down: "+service+" node id => [%v]", id) + delete(n.neighborNodes, id) + } } +//ServiceRegistrar return grpc.ServiceRegistrar of this node, used to create grpc services func (n *Node) ServiceRegistrar() grpc.ServiceRegistrar { return n.nrpc } +//Close . func (n *Node) Close() { if n.nrpc != nil { n.nrpc.Stop() diff --git a/pkg/ion/node_test.go b/pkg/ion/node_test.go index f62d6ff53..565fc216d 100644 --- a/pkg/ion/node_test.go +++ b/pkg/ion/node_test.go @@ -1,25 +1,70 @@ package ion import ( + "sync" "testing" - "github.com/tj/assert" + "github.com/cloudwebrtc/nats-discovery/pkg/discovery" + "github.com/nats-io/nats.go" + log "github.com/pion/ion-log" + "github.com/pion/ion/pkg/proto" + "github.com/pion/ion/pkg/util" + "github.com/stretchr/testify/assert" ) var ( - natURL = "nats://127.0.0.1:4222" + natsURL = "nats://127.0.0.1:4222" + nc *nats.Conn + registry *discovery.Registry + wg *sync.WaitGroup + nid = "testnid001" ) -func TestStart(t *testing.T) { - n := &Node{ - NID: "node-01", +func init() { + fixByFile := []string{"asm_amd64.s", "proc.go"} + fixByFunc := []string{} + log.Init("debug", fixByFile, fixByFunc) + wg = new(sync.WaitGroup) + nc, _ = util.NewNatsConn(natsURL) + var err error + registry, err = discovery.NewRegistry(nc) + if err != nil { + log.Errorf("%v", err) } +} + +func TestWatch(t *testing.T) { + n := NewNode(nid) + + registry.Listen(func(action string, node discovery.Node) { + log.Debugf("handleNode: service %v, action %v => id %v, RPC %v", node.Service, action, node.ID(), node.RPC) + assert.Equal(t, node.NID, nid) + assert.Equal(t, node.Service, proto.ServiceBIZ) + wg.Done() + }) - err := n.Start(natURL) + wg.Add(1) + err := n.Start(natsURL) if err != nil { t.Error(err) } + node := discovery.Node{ + DC: "dc", + Service: proto.ServiceBIZ, + NID: nid, + RPC: discovery.RPC{ + Protocol: discovery.NGRPC, + Addr: natsURL, + //Params: map[string]string{"username": "foo", "password": "bar"}, + }, + } + + go n.KeepAlive(node) + wg.Wait() assert.NotEmpty(t, n.ServiceRegistrar()) + + n.Watch(proto.ServiceBIZ) + n.Close() } diff --git a/pkg/node/avp/avp.go b/pkg/node/avp/avp.go index a6110e901..393fe527b 100644 --- a/pkg/node/avp/avp.go +++ b/pkg/node/avp/avp.go @@ -51,7 +51,7 @@ type AVP struct { // NewAVP create a avp node instance func NewAVP(nid string) *AVP { - return &AVP{Node: ion.Node{NID: nid}} + return &AVP{Node: ion.NewNode(nid)} } // Start avp node @@ -106,7 +106,7 @@ func (a *AVP) Start(conf Config) error { pb.RegisterAVPServer(a.Node.ServiceRegistrar(), a.s) //Watch ISLB nodes. - go a.Node.Watch(proto.ServiceISLB, a.s.watchIslbNodes) + go a.Node.Watch(proto.ServiceISLB) return nil } diff --git a/pkg/node/biz/biz.go b/pkg/node/biz/biz.go index ae081dd0b..b05689f82 100644 --- a/pkg/node/biz/biz.go +++ b/pkg/node/biz/biz.go @@ -58,7 +58,7 @@ type BIZ struct { // NewBIZ create a biz node instance func NewBIZ(nid string) *BIZ { return &BIZ{ - Node: ion.Node{NID: nid}, + Node: ion.NewNode(nid), } } @@ -95,10 +95,10 @@ func (b *BIZ) Start(conf Config) error { go b.Node.KeepAlive(node) - s := newBizServer(conf.Global.Dc, b.NID, conf.Avp.Elements, b.NatsConn()) + s := newBizServer(b, conf.Global.Dc, b.NID, conf.Avp.Elements, b.NatsConn()) //Watch ISLB nodes. - go b.Node.Watch(proto.ServiceISLB, s.watchNodes) + go b.Node.Watch(proto.ServiceISLB) b.s = s diff --git a/pkg/node/biz/biz_test.go b/pkg/node/biz/biz_test.go index e3a1cf7b4..3e4ac560e 100644 --- a/pkg/node/biz/biz_test.go +++ b/pkg/node/biz/biz_test.go @@ -7,7 +7,6 @@ import ( "testing" "time" - "github.com/cloudwebrtc/nats-discovery/pkg/discovery" "github.com/nats-io/nats.go" log "github.com/pion/ion-log" pb "github.com/pion/ion/pkg/grpc/biz" @@ -51,18 +50,18 @@ func init() { s := grpc.NewServer() - bs = newBizServer(dc, nid, []string{}, nc) + bn := NewBIZ(nid) - bs.nodes["islb00"] = &discovery.Node{ - Service: proto.ServiceISLB, - NID: "islb00", - DC: "dc1", - RPC: discovery.RPC{ - Protocol: discovery.NGRPC, - Addr: natsURL, - }, + err = bn.Node.Start(natsURL) + if err != nil { + log.Panicf("failed to start biz node: %v", err) } + bs = newBizServer(bn, dc, nid, []string{}, nc) + + //Watch ISLB nodes. + go bn.Node.Watch(proto.ServiceISLB) + pb.RegisterBizServer(s, bs) go func() { @@ -94,8 +93,10 @@ func TestJBizJoin(t *testing.T) { stream.Send(&pb.SignalRequest{ Payload: &pb.SignalRequest_Join{ Join: &pb.Join{ - Sid: sid, - Uid: uid, + Peer: &ion.Peer{ + Sid: sid, + Uid: uid, + }, }, }, }) @@ -105,13 +106,14 @@ func TestJBizJoin(t *testing.T) { t.Error(err) } + log.Infof("join reply %v", reply) + r := bs.getRoom(sid) assert.EqualValues(t, sid, r.sid) p := r.getPeer(uid) assert.EqualValues(t, uid, p.UID()) - log.Infof("join reply %v", reply) log.Infof("TestJoin done") } diff --git a/pkg/node/biz/room.go b/pkg/node/biz/room.go index e4c6b166c..203c80bd4 100644 --- a/pkg/node/biz/room.go +++ b/pkg/node/biz/room.go @@ -11,15 +11,15 @@ import ( type Room struct { sync.RWMutex sid string - sfuNID string + sfunid string peers map[string]*Peer } // newRoom creates a new room instance -func newRoom(sid string, nid string) *Room { +func newRoom(sid string, sfunid string) *Room { r := &Room{ sid: sid, - sfuNID: nid, + sfunid: sfunid, peers: make(map[string]*Peer), } return r @@ -33,8 +33,18 @@ func (r *Room) SID() string { // addPeer add a peer to room func (r *Room) addPeer(p *Peer) { r.Lock() - defer r.Unlock() r.peers[p.uid] = p + r.Unlock() + + event := &ion.PeerEvent{ + State: ion.PeerEvent_JOIN, + Peer: &ion.Peer{ + Sid: r.sid, + Uid: p.uid, + }, + } + + r.sendPeerEvent(event) } // getPeer get a peer by peer id @@ -54,8 +64,18 @@ func (r *Room) getPeers() map[string]*Peer { // delPeer delete a peer in the room func (r *Room) delPeer(uid string) int { r.Lock() - defer r.Unlock() delete(r.peers, uid) + r.Unlock() + + event := &ion.PeerEvent{ + State: ion.PeerEvent_LEAVE, + Peer: &ion.Peer{ + Sid: r.sid, + Uid: uid, + }, + } + r.sendPeerEvent(event) + return len(r.peers) } @@ -66,7 +86,7 @@ func (r *Room) count() int { return len(r.peers) } -func (r *Room) broadcastPeerEvent(event *ion.PeerEvent) { +func (r *Room) sendPeerEvent(event *ion.PeerEvent) { peers := r.getPeers() for _, p := range peers { if err := p.sendPeerEvent(event); err != nil { @@ -75,7 +95,7 @@ func (r *Room) broadcastPeerEvent(event *ion.PeerEvent) { } } -func (r *Room) broadcastStreamEvent(event *ion.StreamEvent) { +func (r *Room) sendStreamEvent(event *ion.StreamEvent) { peers := r.getPeers() for _, p := range peers { if err := p.sendStreamEvent(event); err != nil { @@ -84,7 +104,7 @@ func (r *Room) broadcastStreamEvent(event *ion.StreamEvent) { } } -func (r *Room) broadcastMessage(msg *ion.Message) { +func (r *Room) sendMessage(msg *ion.Message) { from := msg.From to := msg.To data := msg.Data diff --git a/pkg/node/biz/server.go b/pkg/node/biz/server.go index c30517a57..4386c72d4 100644 --- a/pkg/node/biz/server.go +++ b/pkg/node/biz/server.go @@ -7,12 +7,10 @@ import ( "sync" "time" - "github.com/cloudwebrtc/nats-discovery/pkg/discovery" nrpc "github.com/cloudwebrtc/nats-grpc/pkg/rpc" "github.com/nats-io/nats.go" log "github.com/pion/ion-log" biz "github.com/pion/ion/pkg/grpc/biz" - "github.com/pion/ion/pkg/grpc/ion" islb "github.com/pion/ion/pkg/grpc/islb" "github.com/pion/ion/pkg/proto" "github.com/pion/ion/pkg/util" @@ -27,18 +25,17 @@ type BizServer struct { rooms map[string]*Room closed chan bool islbcli islb.ISLBClient - nodeLock sync.RWMutex - nodes map[string]*discovery.Node + bn *BIZ } // newBizServer creates a new avp server instance -func newBizServer(dc string, nid string, elements []string, nc *nats.Conn) *BizServer { +func newBizServer(bn *BIZ, c string, nid string, elements []string, nc *nats.Conn) *BizServer { return &BizServer{ + bn: bn, nc: nc, elements: elements, rooms: make(map[string]*Room), closed: make(chan bool), - nodes: make(map[string]*discovery.Node), } } @@ -151,16 +148,15 @@ func (s *BizServer) Signal(stream biz.Biz_SignalServer) error { switch payload := req.Payload.(type) { case *biz.SignalRequest_Join: - sid := payload.Join.Sid - uid := payload.Join.Uid + sid := payload.Join.Peer.Sid + uid := payload.Join.Peer.Uid success := false reason := "unkown error." if s.islbcli == nil { - s.nodeLock.Lock() - defer s.nodeLock.Unlock() - for _, node := range s.nodes { + nodes := s.bn.GetNeighborNodes() + for _, node := range nodes { if node.Service == proto.ServiceISLB { ncli := nrpc.NewClient(s.nc, node.NID) s.islbcli = islb.NewISLBClient(ncli) @@ -172,10 +168,12 @@ func (s *BizServer) Signal(stream biz.Biz_SignalServer) error { if s.islbcli != nil { r = s.getRoom(sid) if r == nil { + reason = fmt.Sprintf("room sid = %v not found", sid) resp, err := s.islbcli.FindNode(context.TODO(), &islb.FindNodeRequest{ Service: proto.ServiceSFU, Sid: sid, }) + if err == nil && len(resp.Nodes) > 0 { r = s.createRoom(sid, resp.GetNodes()[0].Nid) } else { @@ -183,23 +181,10 @@ func (s *BizServer) Signal(stream biz.Biz_SignalServer) error { } } if r != nil { - peer = NewPeer(sid, uid, payload.Join.Info, repCh) + peer = NewPeer(sid, uid, payload.Join.Peer.Info, repCh) r.addPeer(peer) - - peerEvent := &ion.PeerEvent{ - State: ion.PeerEvent_JOIN, - Peer: &ion.Peer{ - Uid: uid, - //TODO: Parse the sdp to get the stream parameter set. - Streams: []*ion.Stream{}, - }, - } - r.broadcastPeerEvent(peerEvent) - success = true reason = "join success." - } else { - reason = fmt.Sprintf("room sid = %v not found", sid) } } else { reason = fmt.Sprintf("islb node not found") @@ -221,16 +206,6 @@ func (s *BizServer) Signal(stream biz.Biz_SignalServer) error { peer.Close() peer = nil - peerEvent := &ion.PeerEvent{ - State: ion.PeerEvent_LEAVE, - Peer: &ion.Peer{ - Uid: uid, - //TODO: Parse the sdp to get the stream parameter set. - Streams: []*ion.Stream{}, - }, - } - r.broadcastPeerEvent(peerEvent) - if r.count() == 0 { s.delRoom(r.SID()) r = nil @@ -247,9 +222,9 @@ func (s *BizServer) Signal(stream biz.Biz_SignalServer) error { to := payload.Msg.To data := payload.Msg.Data log.Debugf("Msg request %v => %v, data: %v", from, to, data) - + // message broadcast - r.broadcastMessage(payload.Msg) + r.sendMessage(payload.Msg) default: break } @@ -258,23 +233,6 @@ func (s *BizServer) Signal(stream biz.Biz_SignalServer) error { } } -// watchNodes watch islb nodes up/down -func (s *BizServer) watchNodes(state discovery.NodeState, node *discovery.Node) { - s.nodeLock.Lock() - defer s.nodeLock.Unlock() - id := node.NID - service := node.Service - if state == discovery.NodeUp { - log.Infof("Service up: "+service+" node id => [%v], rpc => %v", id, node.RPC.Protocol) - if _, found := s.nodes[id]; !found { - s.nodes[id] = node - } - } else if state == discovery.NodeDown { - log.Infof("Service down: "+service+" node id => [%v]", id) - delete(s.nodes, id) - } -} - // stat peers func (s *BizServer) stat() { t := time.NewTicker(util.DefaultStatCycle) diff --git a/pkg/node/biz/sfu.go b/pkg/node/biz/sfu.go index 702afd932..71671c27a 100644 --- a/pkg/node/biz/sfu.go +++ b/pkg/node/biz/sfu.go @@ -69,7 +69,7 @@ func (s *SFUSignalBridge) Signal(sstream sfu.SFU_SignalServer) error { if peer != nil { // Use nats-grpc or grpc // TODO: change to util.NewGRPCClientConnForNode. - cli := sfu.NewSFUClient(nrpc.NewClient(s.BizServer.nc, r.sfuNID)) + cli := sfu.NewSFUClient(nrpc.NewClient(s.BizServer.nc, r.sfunid)) var err error cstream, err = cli.Signal(context.Background()) if err != nil { diff --git a/pkg/node/islb/islb.go b/pkg/node/islb/islb.go index be76020d6..4ab5795cb 100644 --- a/pkg/node/islb/islb.go +++ b/pkg/node/islb/islb.go @@ -49,7 +49,7 @@ type ISLB struct { // NewISLB create a islb node instance func NewISLB(nid string) *ISLB { - return &ISLB{Node: ion.Node{NID: nid}} + return &ISLB{Node: ion.NewNode(nid)} } // Start islb node @@ -84,10 +84,10 @@ func (i *ISLB) Start(conf Config) error { return errors.New("new redis error") } - i.s = &islbServer{Redis: i.redis, nodes: make(map[string]discovery.Node)} + i.s = newISLBServer(i, i.redis) pb.RegisterISLBServer(i.Node.ServiceRegistrar(), i.s) - i.registry.Listen(i.s.watchAllNodes) + i.registry.Listen(i.s.handleNodeDiscovery) node := discovery.Node{ DC: conf.Global.Dc, diff --git a/pkg/node/islb/server.go b/pkg/node/islb/server.go index a247c954b..737dd014b 100644 --- a/pkg/node/islb/server.go +++ b/pkg/node/islb/server.go @@ -18,11 +18,23 @@ type islbServer struct { Redis *db.Redis nodeLock sync.Mutex nodes map[string]discovery.Node + in *ISLB } -// handle Node from service discovery. -func (s *islbServer) watchAllNodes(action string, node discovery.Node) { - log.Debugf("handleNode:service %v, action %v => id %v, RPC %v", node.Service, action, node.ID(), node.RPC) +func newISLBServer(in *ISLB, redis *db.Redis) *islbServer { + return &islbServer{ + in: in, + Redis: redis, + nodes: make(map[string]discovery.Node), + } +} + +// handleNodeDiscovery handle all Node from service discovery. +// This callback can observe all nodes in the ion cluster, +// TODO: Upload all node information to redis DB so that info +// can be shared when there are more than one ISLB in the later. +func (s *islbServer) handleNodeDiscovery(action string, node discovery.Node) { + log.Debugf("handleNode: service %v, action %v => id %v, RPC %v", node.Service, action, node.ID(), node.RPC) s.nodeLock.Lock() defer s.nodeLock.Unlock() switch action { @@ -35,12 +47,13 @@ func (s *islbServer) watchAllNodes(action string, node discovery.Node) { } } +// FindNode find service nodes by service name|nid|sid, such as sfu|avp|sip-gateway|rtmp-gateway func (s *islbServer) FindNode(ctx context.Context, req *proto.FindNodeRequest) (*proto.FindNodeReply, error) { nid := req.GetNid() sid := req.GetSid() service := req.GetService() - log.Infof("nid => %v, sid => %v, service => %v", nid, sid, service) + log.Infof("islb.FindNode: nid => %v, sid => %v, service => %v", nid, sid, service) nodes := []*ion.Node{} @@ -55,6 +68,7 @@ func (s *islbServer) FindNode(ctx context.Context, req *proto.FindNodeRequest) ( s.nodeLock.Lock() defer s.nodeLock.Unlock() // find node by nid or service + //TODO: Add load balancing algorithm to select SFU nodes for _, node := range s.nodes { if nid == node.NID || service == node.Service { nodes = append(nodes, &ion.Node{ @@ -98,35 +112,23 @@ func (s *islbServer) HandleSessionState(ctx context.Context, state *ion.SessionR } */ -func (s *islbServer) PostEvent(context.Context, *proto.ISLBEvent) (*ion.Empty, error) { +//PostISLBEvent Receive ISLBEvent(stream or session events) from ion-SFU, ion-AVP and ion-SIP +//the stream and session event will be save to redis db, which is used to create the +//global location of the media stream +// key = dc/ion-sfu-1/room1/uid +// value = [...stream/track info ...] +func (s *islbServer) PostISLBEvent(context.Context, *proto.ISLBEvent) (*ion.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method PostEvent not implemented") } -func (s *islbServer) HandleEvent(*ion.Empty, proto.ISLB_HandleEventServer) error { +//WatchISLBEvent broadcast ISLBEvent to ion-biz node. +//The stream metadata is forwarded to biz node and coupled with the peer in the client through UID +func (s *islbServer) WatchISLBEvent(*ion.Empty, proto.ISLB_WatchISLBEventServer) error { return status.Errorf(codes.Unimplemented, "method HandleEvent not implemented") } /* -func (s *islbServer) handle(msg interface{}) (interface{}, error) { - log.Infof("handleRequest: %T, %+v", msg, msg) - - switch v := msg.(type) { - case *proto.ToIslbFindNodeMsg: - return s.findNode(v) - case *proto.ToIslbPeerJoinMsg: - return s.peerJoin(v) - case *proto.IslbPeerLeaveMsg: - return s.peerLeave(v) - case *proto.ToIslbStreamAddMsg: - return s.streamAdd(v) - case *proto.IslbBroadcastMsg: - return s.broadcast(v) - default: - return nil, errors.New("unkonw message") - } -} -// Find service nodes by name, such as sfu|avp|sip-gateway|rtmp-gateway func (s *islbServer) findNode(msg *proto.ToIslbFindNodeMsg) (interface{}, error) { service := msg.Service nodes := s.getNodes() @@ -230,105 +232,4 @@ func (s *islbServer) streamAdd(msg *proto.ToIslbStreamAddMsg) (interface{}, erro return nil, err } - -func (s *islbServer) peerJoin(msg *proto.ToIslbPeerJoinMsg) (interface{}, error) { - ukey := proto.UserInfo{ - DC: s.dc, - SID: msg.SID, - UID: msg.UID, - }.BuildKey() - log.Infof("clientJoin: set %s => %v", ukey, string(msg.Info)) - - // Tell everyone about the new peer. - if err := s.nrpc.Publish(s.bid, proto.ToClientPeerJoinMsg{ - UID: msg.UID, SID: msg.SID, Info: msg.Info, - }); err != nil { - log.Errorf("broadcast peer-join error: %v", err) - return nil, err - } - - // Tell the new peer about everyone currently in the room. - searchKey := proto.UserInfo{ - DC: s.dc, - SID: msg.SID, - }.BuildKey() - keys := s.redis.Keys(searchKey) - - peers := make([]proto.Peer, 0) - streams := make([]proto.Stream, 0) - for _, key := range keys { - fields := s.redis.HGetAll(key) - parsedUserKey, err := proto.ParseUserInfo(key) - if err != nil { - log.Errorf("redis.HGetAll err = %v", err) - continue - } - if info, ok := fields["info"]; ok { - peers = append(peers, proto.Peer{ - UID: parsedUserKey.UID, - Info: json.RawMessage(info), - }) - } else { - log.Warnf("No info found for %v", key) - } - - mkey := proto.MediaInfo{ - DC: s.dc, - SID: msg.SID, - UID: parsedUserKey.UID, - }.BuildKey() - mediaKeys := s.redis.Keys(mkey) - for _, mediaKey := range mediaKeys { - mediaFields := s.redis.HGetAll(mediaKey) - for mediaField := range mediaFields { - log.Warnf("Received media field %s for key %s", mediaField, mediaKey) - if len(mediaField) > 6 && mediaField[:6] == "track/" { - streams = append(streams, proto.Stream{ - UID: parsedUserKey.UID, - StreamID: proto.StreamID(mediaField[6:]), - }) - } - } - } - } - - // Write the user info to redis. - err := s.redis.HSetTTL(ukey, "info", string(msg.Info), redisLongKeyTTL) - if err != nil { - log.Errorf("redis.HSetTTL err = %v", err) - } - - return proto.FromIslbPeerJoinMsg{ - Peers: peers, - Streams: streams, - }, nil -} - -func (s *islbServer) peerLeave(msg *proto.IslbPeerLeaveMsg) (interface{}, error) { - ukey := proto.UserInfo{ - DC: s.dc, - SID: msg.SID, - UID: msg.UID, - }.BuildKey() - log.Infof("clientLeave: remove key => %s", ukey) - err := s.redis.Del(ukey) - if err != nil { - log.Errorf("redis.Del err = %v", err) - } - - if err := s.nrpc.Publish(s.bid, msg); err != nil { - log.Errorf("broadcast peer-leave error: %v", err) - return nil, err - } - - return nil, nil -} - -func (s *islbServer) broadcast(msg *proto.IslbBroadcastMsg) (interface{}, error) { - if err := s.nrpc.Publish(s.bid, msg); err != nil { - log.Errorf("broadcast message error: %v", err) - } - - return nil, nil -} */ diff --git a/pkg/node/sfu/server.go b/pkg/node/sfu/server.go index 3fd3f5383..1b4c29e73 100644 --- a/pkg/node/sfu/server.go +++ b/pkg/node/sfu/server.go @@ -1,15 +1,20 @@ package sfu import ( + "context" "encoding/json" "fmt" "io" - "sync" - "github.com/cloudwebrtc/nats-discovery/pkg/discovery" + nrpc "github.com/cloudwebrtc/nats-grpc/pkg/rpc" + "github.com/nats-io/nats.go" log "github.com/pion/ion-log" - sfu "github.com/pion/ion-sfu/pkg/sfu" + isfu "github.com/pion/ion-sfu/pkg/sfu" + "github.com/pion/ion/pkg/grpc/ion" + "github.com/pion/ion/pkg/grpc/islb" pb "github.com/pion/ion/pkg/grpc/sfu" + "github.com/pion/ion/pkg/proto" + "github.com/pion/ion/pkg/util" "github.com/pion/webrtc/v3" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -17,33 +22,38 @@ import ( type sfuServer struct { pb.UnimplementedSFUServer - sfu *sfu.SFU - nodeLock sync.RWMutex - nodes map[string]*discovery.Node + nc *nats.Conn + sfu *isfu.SFU + islbcli islb.ISLBClient + sn *SFU } -func newSFUServer(sfu *sfu.SFU) *sfuServer { - return &sfuServer{sfu: sfu, nodes: make(map[string]*discovery.Node)} +func newSFUServer(sn *SFU, sfu *isfu.SFU, nc *nats.Conn) *sfuServer { + return &sfuServer{sn: sn, sfu: sfu, nc: nc} } -// watchIslbNodes watch islb nodes up/down -func (s *sfuServer) watchIslbNodes(state discovery.NodeState, node *discovery.Node) { - s.nodeLock.Lock() - defer s.nodeLock.Unlock() - id := node.NID - if state == discovery.NodeUp { - log.Infof("islb node %v up", id) - if _, found := s.nodes[id]; !found { - s.nodes[id] = node +func (s *sfuServer) postISLBEvent(event *islb.ISLBEvent) { + if s.islbcli == nil { + nodes := s.sn.GetNeighborNodes() + for _, node := range nodes { + if node.Service == proto.ServiceISLB { + ncli := nrpc.NewClient(s.nc, node.NID) + s.islbcli = islb.NewISLBClient(ncli) + break + } + } + } + + if s.islbcli != nil { + _, err := s.islbcli.PostISLBEvent(context.Background(), event) + if err != nil { + log.Errorf("PostISLBEvent err %v", err) } - } else if state == discovery.NodeDown { - log.Infof("islb node %v down", id) - delete(s.nodes, id) } } func (s *sfuServer) Signal(stream pb.SFU_SignalServer) error { - peer := sfu.NewPeer(s.sfu) + peer := isfu.NewPeer(s.sfu) for { in, err := stream.Recv() @@ -141,9 +151,9 @@ func (s *sfuServer) Signal(stream pb.SFU_SignalServer) error { err = peer.Join(payload.Join.Sid, payload.Join.Uid) if err != nil { switch err { - case sfu.ErrTransportExists: + case isfu.ErrTransportExists: fallthrough - case sfu.ErrOfferIgnored: + case isfu.ErrOfferIgnored: err = stream.Send(&pb.SignalReply{ Payload: &pb.SignalReply_Error{ Error: fmt.Errorf("join error: %w", err).Error(), @@ -198,13 +208,29 @@ func (s *sfuServer) Signal(stream pb.SFU_SignalServer) error { } } + streams, err := util.ParseSDP(sdp.SDP) + if err != nil { + log.Errorf("util.ParseSDP error: %v", err) + } + + s.postISLBEvent(&islb.ISLBEvent{ + Payload: &islb.ISLBEvent_Stream{ + Stream: &ion.StreamEvent{ + Sid: peer.Session().ID(), + Uid: peer.ID(), + Streams: streams, + State: ion.StreamEvent_NEW, + }, + }, + }) + if sdp.Type == webrtc.SDPTypeOffer { answer, err := peer.Answer(sdp) if err != nil { switch err { - case sfu.ErrNoTransportEstablished: + case isfu.ErrNoTransportEstablished: fallthrough - case sfu.ErrOfferIgnored: + case isfu.ErrOfferIgnored: err = stream.Send(&pb.SignalReply{ Payload: &pb.SignalReply_Error{ Error: fmt.Errorf("negotiate answer error: %w", err).Error(), @@ -247,7 +273,7 @@ func (s *sfuServer) Signal(stream pb.SFU_SignalServer) error { err := peer.SetRemoteDescription(sdp) if err != nil { switch err { - case sfu.ErrNoTransportEstablished: + case isfu.ErrNoTransportEstablished: err = stream.Send(&pb.SignalReply{ Payload: &pb.SignalReply_Error{ Error: fmt.Errorf("set remote description error: %w", err).Error(), @@ -283,7 +309,7 @@ func (s *sfuServer) Signal(stream pb.SFU_SignalServer) error { err = peer.Trickle(candidate, int(payload.Trickle.Target)) if err != nil { switch err { - case sfu.ErrNoTransportEstablished: + case isfu.ErrNoTransportEstablished: log.Errorf("peer hasn't joined, error -> %v", err) err = stream.Send(&pb.SignalReply{ Payload: &pb.SignalReply_Error{ diff --git a/pkg/node/sfu/sfu.go b/pkg/node/sfu/sfu.go index 6bea07df3..8306e36fb 100644 --- a/pkg/node/sfu/sfu.go +++ b/pkg/node/sfu/sfu.go @@ -36,7 +36,7 @@ type SFU struct { // NewSFU create a sfu node instance func NewSFU(nid string) *SFU { s := &SFU{ - Node: ion.Node{NID: nid}, + Node: ion.NewNode(nid), } return s } @@ -74,12 +74,12 @@ func (s *SFU) Start(conf Config) error { go s.Node.KeepAlive(node) - s.s = newSFUServer(isfu.NewSFU(conf.Config)) + s.s = newSFUServer(s, isfu.NewSFU(conf.Config), s.NatsConn()) //grpc service psfu.RegisterSFUServer(s.Node.ServiceRegistrar(), s.s) //Watch ISLB nodes. - go s.Node.Watch(proto.ServiceISLB, s.s.watchIslbNodes) + go s.Node.Watch(proto.ServiceISLB) return nil } diff --git a/pkg/util/sdp.go b/pkg/util/sdp.go new file mode 100644 index 000000000..2400180dc --- /dev/null +++ b/pkg/util/sdp.go @@ -0,0 +1,80 @@ +package util + +import ( + "strings" + + log "github.com/pion/ion-log" + "github.com/pion/ion/pkg/grpc/ion" + "github.com/pixelbender/go-sdp/sdp" +) + +//ParseSDP . +func ParseSDP(sdpstr string) ([]*ion.Stream, error) { + sess, err := sdp.ParseString(sdpstr) + + if err != nil { + log.Errorf("sdp.Parse erro %v", err) + return nil, err + } + + streams := make(map[string]*ion.Stream) + for _, m := range sess.Media { + //fmt.Printf("type = %v\n", m.Type) + + if m.Type == "audio" || m.Type == "video" { + msid := m.Attributes.Get("msid") + //fmt.Printf("msid id = %v\n", msid) + + strs := strings.Split(msid, " ") + streamID := strs[0] + trackID := msid + trackLabel := strs[1] + + track := &ion.Track{ + Kind: m.Type, + Id: trackID, + Label: trackLabel, + } + + simulcast := make(map[string]string) + for _, attr := range m.Attributes { + //fmt.Printf("attr name = %v, value = %v\n", attr.Name, attr.Value) + + if attr.Name == "rid" { + strs := strings.Split(attr.Value, " ") + rid := strs[0] + dir := strs[1] + //fmt.Printf("rid: rid = %v, dir = %v\n", rid, dir) + simulcast[rid] = dir + } + /* + if attr.Name == "simulcast" { + strs := strings.Split(attr.Value, " ") + dir := strs[0] + rids := strs[1] + fmt.Printf("simulcast: rids = %v, dir = %v\n", rids, dir) + } + */ + } + track.Simulcast = simulcast + + if stream, ok := streams[streamID]; ok { + stream.Tracks = append(stream.Tracks, track) + } else { + stream = &ion.Stream{ + Id: streamID, + } + stream.Tracks = append(stream.Tracks, track) + streams[streamID] = stream + } + } + } + + var list []*ion.Stream + for _, stream := range streams { + //fmt.Printf("%v\n", stream.String()) + list = append(list, stream) + } + + return list, nil +} diff --git a/protos/avp.proto b/protos/avp.proto index 75c66745f..a7c1718bd 100644 --- a/protos/avp.proto +++ b/protos/avp.proto @@ -33,7 +33,7 @@ message Element { // webmsaver/mixer/opencv/play/record/ml string name = 1; // params for element. - repeated ion.Parameter parameters = 2; + map params = 2; } message AVPRequest { diff --git a/protos/biz.proto b/protos/biz.proto index d336fe6ba..84ac36fb9 100644 --- a/protos/biz.proto +++ b/protos/biz.proto @@ -11,10 +11,8 @@ service Biz { } message Join { - string sid = 1; - string uid = 2; - bytes info = 3; - string token = 4; + ion.Peer peer = 1; + string token = 2; } message JoinReply { diff --git a/protos/ion.proto b/protos/ion.proto index 9ad7809b7..14e31f003 100644 --- a/protos/ion.proto +++ b/protos/ion.proto @@ -8,10 +8,9 @@ message Empty {} message Track { string id = 1; - string kind = 2; - string rid = 3; - uint32 ssrc = 4; - string codec = 5; + string label = 2; + string kind = 3; + map simulcast = 4; } message Stream { @@ -20,14 +19,9 @@ message Stream { } message Peer { - string uid = 1; - repeated Stream streams = 2; -} - -message Session { - Node node = 1; - string sid = 3; - repeated Peer peers = 4; + string sid = 1; + string uid = 2; + bytes info = 3; } // Describe the basic media info in the session of sfu. @@ -39,34 +33,36 @@ message Session { // ${msid}: [{id: ${trackId}, kind:audio}, {id: ${trackId}, kind:video}] // ] -message SessionReport { - enum State { - NEW = 0; - UPDATE = 1; - DELETE = 2; - } - State state = 3; - ion.Session session = 4; -} - -message PeerEvent { +message SessionEvent { enum State { - JOIN = 0; - LEAVE = 1; + NEW = 0; + DELETE = 1; } State state = 2; - ion.Peer peer = 3; + string nid = 3; + string sid = 4; } message StreamEvent { enum State { - ADD = 0; + NEW = 0; + DELETE = 2; + } + State state = 3; + string nid = 4; + string sid = 5; + string uid = 6; + repeated ion.Stream streams = 7; +} + +message PeerEvent { + enum State { + JOIN = 0; UPDATE = 1; - REMOVE = 2; + LEAVE = 2; } - string uid = 3; - State state = 4; - repeated ion.Stream streams = 5; + State state = 3; + ion.Peer peer = 4; } message Message { @@ -83,7 +79,7 @@ message Parameter { message RPC { string protocol = 1; string addr = 2; - repeated Parameter params = 3; + map params = 3; } message Node { diff --git a/protos/islb.proto b/protos/islb.proto index eecaa1014..997c1d907 100644 --- a/protos/islb.proto +++ b/protos/islb.proto @@ -9,9 +9,9 @@ package islb; service ISLB { rpc FindNode(FindNodeRequest) returns (FindNodeReply) {} - rpc PostEvent(ISLBEvent) returns (ion.Empty){} + rpc PostISLBEvent(ISLBEvent) returns (ion.Empty) {} - rpc HandleEvent(ion.Empty) returns (stream ISLBEvent) {} + rpc WatchISLBEvent(ion.Empty) returns (stream ISLBEvent) {} } message FindNodeRequest { @@ -24,10 +24,13 @@ message FindNodeReply { repeated ion.Node nodes = 1; } +message WatchRequest { + +} + message ISLBEvent { oneof payload { - ion.PeerEvent peerEvent = 2; - ion.StreamEvent streamEvent = 3; - ion.Message msg = 4; + ion.SessionEvent session = 1; + ion.StreamEvent stream = 2; } }