From fa21ae616111b0e66a564fd672f3f9bf0ea1dc53 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Wed, 16 Mar 2022 14:59:15 +0800 Subject: [PATCH] rtc add --- internal/rpc/rtc/rtc.go | 13 +- pkg/proto/rtc/rtc.pb.go | 455 +++++++++++++++------------------------- pkg/proto/rtc/rtc.proto | 5 +- 3 files changed, 182 insertions(+), 291 deletions(-) diff --git a/internal/rpc/rtc/rtc.go b/internal/rpc/rtc/rtc.go index 14befba6c..e9dff0c9d 100644 --- a/internal/rpc/rtc/rtc.go +++ b/internal/rpc/rtc/rtc.go @@ -1,10 +1,12 @@ package rtc import ( + "Open_IM/pkg/common/constant" "Open_IM/pkg/common/log" pbRtc "Open_IM/pkg/proto/rtc" "Open_IM/pkg/utils" "context" + "encoding/json" "time" "github.com/livekit/protocol/auth" @@ -12,7 +14,6 @@ import ( ) type RtcService struct { - } func (r *RtcService) GetJoinToken(_ context.Context, req *pbRtc.GetJoinTokenReq) (resp *pbRtc.GetJoinTokenResp, err error) { @@ -27,11 +28,17 @@ func (r *RtcService) GetJoinToken(_ context.Context, req *pbRtc.GetJoinTokenReq) CanPublish: &canPublish, CanSubscribe: &canSubscribe, } + byte, err := json.Marshal(req.MetaData) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "json marshal failed", err.Error()) + resp.CommonResp = &pbRtc.CommonResp{ErrCode: constant.ErrArgs.ErrCode, ErrMsg: constant.ErrArgs.ErrMsg} + return + } at.AddGrant(grant). SetIdentity(req.Identity). // optional SetName("participant-name"). - SetValidFor(time.Hour) + SetValidFor(time.Hour).SetMetadata(string(byte)) jwt, err := at.ToJWT() if err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), "toJwt failed", err.Error(), "jwt: ", jwt) @@ -40,4 +47,4 @@ func (r *RtcService) GetJoinToken(_ context.Context, req *pbRtc.GetJoinTokenReq) resp.CommonResp = &pbRtc.CommonResp{} log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) return resp, err -} \ No newline at end of file +} diff --git a/pkg/proto/rtc/rtc.pb.go b/pkg/proto/rtc/rtc.pb.go index 0c993917b..a1b439537 100644 --- a/pkg/proto/rtc/rtc.pb.go +++ b/pkg/proto/rtc/rtc.pb.go @@ -1,387 +1,242 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.1 -// protoc v3.15.5 // source: rtc/rtc.proto -package rtc +package rtc // import "./rtc" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import sdk_ws "Open_IM/pkg/proto/sdk_ws" import ( - context "context" + context "golang.org/x/net/context" grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf -type CommonResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - ErrCode int32 `protobuf:"varint,1,opt,name=errCode,proto3" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg,proto3" json:"errMsg,omitempty"` +type CommonResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *CommonResp) Reset() { - *x = CommonResp{} - if protoimpl.UnsafeEnabled { - mi := &file_rtc_rtc_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (m *CommonResp) Reset() { *m = CommonResp{} } +func (m *CommonResp) String() string { return proto.CompactTextString(m) } +func (*CommonResp) ProtoMessage() {} +func (*CommonResp) Descriptor() ([]byte, []int) { + return fileDescriptor_rtc_058fd4200139f42f, []int{0} } - -func (x *CommonResp) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *CommonResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommonResp.Unmarshal(m, b) } - -func (*CommonResp) ProtoMessage() {} - -func (x *CommonResp) ProtoReflect() protoreflect.Message { - mi := &file_rtc_rtc_proto_msgTypes[0] - 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) +func (m *CommonResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommonResp.Marshal(b, m, deterministic) } - -// Deprecated: Use CommonResp.ProtoReflect.Descriptor instead. -func (*CommonResp) Descriptor() ([]byte, []int) { - return file_rtc_rtc_proto_rawDescGZIP(), []int{0} +func (dst *CommonResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommonResp.Merge(dst, src) +} +func (m *CommonResp) XXX_Size() int { + return xxx_messageInfo_CommonResp.Size(m) +} +func (m *CommonResp) XXX_DiscardUnknown() { + xxx_messageInfo_CommonResp.DiscardUnknown(m) } -func (x *CommonResp) GetErrCode() int32 { - if x != nil { - return x.ErrCode +var xxx_messageInfo_CommonResp proto.InternalMessageInfo + +func (m *CommonResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode } return 0 } -func (x *CommonResp) GetErrMsg() string { - if x != nil { - return x.ErrMsg +func (m *CommonResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg } return "" } type GetJoinTokenReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ApiKey string `protobuf:"bytes,1,opt,name=apiKey,proto3" json:"apiKey,omitempty"` - ApiSecret string `protobuf:"bytes,2,opt,name=apiSecret,proto3" json:"apiSecret,omitempty"` - Room string `protobuf:"bytes,3,opt,name=room,proto3" json:"room,omitempty"` - Identity string `protobuf:"bytes,4,opt,name=identity,proto3" json:"identity,omitempty"` - OperationID string `protobuf:"bytes,5,opt,name=operationID,proto3" json:"operationID,omitempty"` -} - -func (x *GetJoinTokenReq) Reset() { - *x = GetJoinTokenReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rtc_rtc_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + ApiKey string `protobuf:"bytes,1,opt,name=apiKey" json:"apiKey,omitempty"` + ApiSecret string `protobuf:"bytes,2,opt,name=apiSecret" json:"apiSecret,omitempty"` + Room string `protobuf:"bytes,3,opt,name=room" json:"room,omitempty"` + Identity string `protobuf:"bytes,4,opt,name=identity" json:"identity,omitempty"` + MetaData *sdk_ws.ParticipantMetaData `protobuf:"bytes,5,opt,name=metaData" json:"metaData,omitempty"` + OperationID string `protobuf:"bytes,6,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetJoinTokenReq) Reset() { *m = GetJoinTokenReq{} } +func (m *GetJoinTokenReq) String() string { return proto.CompactTextString(m) } +func (*GetJoinTokenReq) ProtoMessage() {} +func (*GetJoinTokenReq) Descriptor() ([]byte, []int) { + return fileDescriptor_rtc_058fd4200139f42f, []int{1} } - -func (x *GetJoinTokenReq) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *GetJoinTokenReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetJoinTokenReq.Unmarshal(m, b) +} +func (m *GetJoinTokenReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetJoinTokenReq.Marshal(b, m, deterministic) +} +func (dst *GetJoinTokenReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetJoinTokenReq.Merge(dst, src) +} +func (m *GetJoinTokenReq) XXX_Size() int { + return xxx_messageInfo_GetJoinTokenReq.Size(m) +} +func (m *GetJoinTokenReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetJoinTokenReq.DiscardUnknown(m) } -func (*GetJoinTokenReq) ProtoMessage() {} +var xxx_messageInfo_GetJoinTokenReq proto.InternalMessageInfo -func (x *GetJoinTokenReq) ProtoReflect() protoreflect.Message { - mi := &file_rtc_rtc_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms +func (m *GetJoinTokenReq) GetApiKey() string { + if m != nil { + return m.ApiKey } - return mi.MessageOf(x) -} - -// Deprecated: Use GetJoinTokenReq.ProtoReflect.Descriptor instead. -func (*GetJoinTokenReq) Descriptor() ([]byte, []int) { - return file_rtc_rtc_proto_rawDescGZIP(), []int{1} + return "" } -func (x *GetJoinTokenReq) GetApiKey() string { - if x != nil { - return x.ApiKey +func (m *GetJoinTokenReq) GetApiSecret() string { + if m != nil { + return m.ApiSecret } return "" } -func (x *GetJoinTokenReq) GetApiSecret() string { - if x != nil { - return x.ApiSecret +func (m *GetJoinTokenReq) GetRoom() string { + if m != nil { + return m.Room } return "" } -func (x *GetJoinTokenReq) GetRoom() string { - if x != nil { - return x.Room +func (m *GetJoinTokenReq) GetIdentity() string { + if m != nil { + return m.Identity } return "" } -func (x *GetJoinTokenReq) GetIdentity() string { - if x != nil { - return x.Identity +func (m *GetJoinTokenReq) GetMetaData() *sdk_ws.ParticipantMetaData { + if m != nil { + return m.MetaData } - return "" + return nil } -func (x *GetJoinTokenReq) GetOperationID() string { - if x != nil { - return x.OperationID +func (m *GetJoinTokenReq) GetOperationID() string { + if m != nil { + return m.OperationID } return "" } type GetJoinTokenResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp,proto3" json:"CommonResp,omitempty"` - Jwt string `protobuf:"bytes,2,opt,name=jwt,proto3" json:"jwt,omitempty"` + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + Jwt string `protobuf:"bytes,2,opt,name=jwt" json:"jwt,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *GetJoinTokenResp) Reset() { - *x = GetJoinTokenResp{} - if protoimpl.UnsafeEnabled { - mi := &file_rtc_rtc_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (m *GetJoinTokenResp) Reset() { *m = GetJoinTokenResp{} } +func (m *GetJoinTokenResp) String() string { return proto.CompactTextString(m) } +func (*GetJoinTokenResp) ProtoMessage() {} +func (*GetJoinTokenResp) Descriptor() ([]byte, []int) { + return fileDescriptor_rtc_058fd4200139f42f, []int{2} } - -func (x *GetJoinTokenResp) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *GetJoinTokenResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetJoinTokenResp.Unmarshal(m, b) } - -func (*GetJoinTokenResp) ProtoMessage() {} - -func (x *GetJoinTokenResp) ProtoReflect() protoreflect.Message { - mi := &file_rtc_rtc_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) +func (m *GetJoinTokenResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetJoinTokenResp.Marshal(b, m, deterministic) } - -// Deprecated: Use GetJoinTokenResp.ProtoReflect.Descriptor instead. -func (*GetJoinTokenResp) Descriptor() ([]byte, []int) { - return file_rtc_rtc_proto_rawDescGZIP(), []int{2} +func (dst *GetJoinTokenResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetJoinTokenResp.Merge(dst, src) } +func (m *GetJoinTokenResp) XXX_Size() int { + return xxx_messageInfo_GetJoinTokenResp.Size(m) +} +func (m *GetJoinTokenResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetJoinTokenResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetJoinTokenResp proto.InternalMessageInfo -func (x *GetJoinTokenResp) GetCommonResp() *CommonResp { - if x != nil { - return x.CommonResp +func (m *GetJoinTokenResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp } return nil } -func (x *GetJoinTokenResp) GetJwt() string { - if x != nil { - return x.Jwt +func (m *GetJoinTokenResp) GetJwt() string { + if m != nil { + return m.Jwt } return "" } -var File_rtc_rtc_proto protoreflect.FileDescriptor - -var file_rtc_rtc_proto_rawDesc = []byte{ - 0x0a, 0x0d, 0x72, 0x74, 0x63, 0x2f, 0x72, 0x74, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x03, 0x72, 0x74, 0x63, 0x22, 0x3e, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, - 0x72, 0x4d, 0x73, 0x67, 0x22, 0x99, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x69, 0x6e, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x70, 0x69, 0x4b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x70, 0x69, 0x4b, 0x65, 0x79, - 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x70, 0x69, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x70, 0x69, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x12, - 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, - 0x6f, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x20, - 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, - 0x22, 0x55, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x2f, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x72, 0x74, 0x63, 0x2e, 0x43, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6a, 0x77, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6a, 0x77, 0x74, 0x32, 0x49, 0x0a, 0x0a, 0x52, 0x74, 0x63, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x69, 0x6e, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x2e, 0x72, 0x74, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4a, - 0x6f, 0x69, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x72, 0x74, - 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x72, 0x74, 0x63, 0x3b, 0x72, 0x74, 0x63, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_rtc_rtc_proto_rawDescOnce sync.Once - file_rtc_rtc_proto_rawDescData = file_rtc_rtc_proto_rawDesc -) - -func file_rtc_rtc_proto_rawDescGZIP() []byte { - file_rtc_rtc_proto_rawDescOnce.Do(func() { - file_rtc_rtc_proto_rawDescData = protoimpl.X.CompressGZIP(file_rtc_rtc_proto_rawDescData) - }) - return file_rtc_rtc_proto_rawDescData -} - -var file_rtc_rtc_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_rtc_rtc_proto_goTypes = []interface{}{ - (*CommonResp)(nil), // 0: rtc.CommonResp - (*GetJoinTokenReq)(nil), // 1: rtc.GetJoinTokenReq - (*GetJoinTokenResp)(nil), // 2: rtc.GetJoinTokenResp -} -var file_rtc_rtc_proto_depIdxs = []int32{ - 0, // 0: rtc.GetJoinTokenResp.CommonResp:type_name -> rtc.CommonResp - 1, // 1: rtc.RtcService.GetJoinToken:input_type -> rtc.GetJoinTokenReq - 2, // 2: rtc.RtcService.GetJoinToken:output_type -> rtc.GetJoinTokenResp - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_rtc_rtc_proto_init() } -func file_rtc_rtc_proto_init() { - if File_rtc_rtc_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_rtc_rtc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommonResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rtc_rtc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetJoinTokenReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rtc_rtc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetJoinTokenResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_rtc_rtc_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_rtc_rtc_proto_goTypes, - DependencyIndexes: file_rtc_rtc_proto_depIdxs, - MessageInfos: file_rtc_rtc_proto_msgTypes, - }.Build() - File_rtc_rtc_proto = out.File - file_rtc_rtc_proto_rawDesc = nil - file_rtc_rtc_proto_goTypes = nil - file_rtc_rtc_proto_depIdxs = nil +func init() { + proto.RegisterType((*CommonResp)(nil), "rtc.CommonResp") + proto.RegisterType((*GetJoinTokenReq)(nil), "rtc.GetJoinTokenReq") + proto.RegisterType((*GetJoinTokenResp)(nil), "rtc.GetJoinTokenResp") } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConnInterface +var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 +const _ = grpc.SupportPackageIsVersion4 + +// Client API for RtcService service -// RtcServiceClient is the client API for RtcService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type RtcServiceClient interface { GetJoinToken(ctx context.Context, in *GetJoinTokenReq, opts ...grpc.CallOption) (*GetJoinTokenResp, error) } type rtcServiceClient struct { - cc grpc.ClientConnInterface + cc *grpc.ClientConn } -func NewRtcServiceClient(cc grpc.ClientConnInterface) RtcServiceClient { +func NewRtcServiceClient(cc *grpc.ClientConn) RtcServiceClient { return &rtcServiceClient{cc} } func (c *rtcServiceClient) GetJoinToken(ctx context.Context, in *GetJoinTokenReq, opts ...grpc.CallOption) (*GetJoinTokenResp, error) { out := new(GetJoinTokenResp) - err := c.cc.Invoke(ctx, "/rtc.RtcService/GetJoinToken", in, out, opts...) + err := grpc.Invoke(ctx, "/rtc.RtcService/GetJoinToken", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } -// RtcServiceServer is the server API for RtcService service. +// Server API for RtcService service + type RtcServiceServer interface { GetJoinToken(context.Context, *GetJoinTokenReq) (*GetJoinTokenResp, error) } -// UnimplementedRtcServiceServer can be embedded to have forward compatible implementations. -type UnimplementedRtcServiceServer struct { -} - -func (*UnimplementedRtcServiceServer) GetJoinToken(context.Context, *GetJoinTokenReq) (*GetJoinTokenResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetJoinToken not implemented") -} - func RegisterRtcServiceServer(s *grpc.Server, srv RtcServiceServer) { s.RegisterService(&_RtcService_serviceDesc, srv) } @@ -416,3 +271,31 @@ var _RtcService_serviceDesc = grpc.ServiceDesc{ Streams: []grpc.StreamDesc{}, Metadata: "rtc/rtc.proto", } + +func init() { proto.RegisterFile("rtc/rtc.proto", fileDescriptor_rtc_058fd4200139f42f) } + +var fileDescriptor_rtc_058fd4200139f42f = []byte{ + // 343 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0x4f, 0x6b, 0xdb, 0x40, + 0x10, 0xc5, 0x51, 0xfd, 0xa7, 0xd6, 0xa8, 0xc5, 0x66, 0x69, 0x8b, 0x30, 0x3d, 0xa8, 0x3e, 0x14, + 0x9f, 0x24, 0x70, 0x8f, 0x86, 0x1e, 0x6c, 0x43, 0x71, 0x83, 0x49, 0x58, 0x27, 0x97, 0x5c, 0xc4, + 0x66, 0x3d, 0x98, 0x8d, 0x91, 0x76, 0x33, 0xbb, 0xd8, 0xf8, 0xc3, 0xe6, 0xbb, 0x04, 0x6d, 0x64, + 0x5b, 0x09, 0xb9, 0xcd, 0xfb, 0xed, 0xec, 0x0c, 0xef, 0x0d, 0x7c, 0x25, 0x27, 0x33, 0x72, 0x32, + 0x35, 0xa4, 0x9d, 0x66, 0x2d, 0x72, 0x72, 0xf8, 0xeb, 0xda, 0x60, 0x99, 0x2f, 0x57, 0x99, 0xd9, + 0x6d, 0x33, 0xcf, 0x33, 0xbb, 0xd9, 0xe5, 0x07, 0x9b, 0x1d, 0xec, 0x6b, 0xdf, 0xe8, 0x2f, 0xc0, + 0x5c, 0x17, 0x85, 0x2e, 0x39, 0x5a, 0xc3, 0x62, 0xf8, 0x8c, 0x44, 0x73, 0xbd, 0xc1, 0x38, 0x48, + 0x82, 0x71, 0x87, 0x9f, 0x24, 0xfb, 0x01, 0x5d, 0x24, 0x5a, 0xd9, 0x6d, 0xfc, 0x29, 0x09, 0xc6, + 0x21, 0xaf, 0xd5, 0xe8, 0x39, 0x80, 0xfe, 0x3f, 0x74, 0xff, 0xb5, 0x2a, 0x6f, 0xf5, 0x0e, 0x4b, + 0x8e, 0x4f, 0x55, 0xaf, 0x30, 0xea, 0x0a, 0x8f, 0x7e, 0x48, 0xc8, 0x6b, 0xc5, 0x7e, 0x42, 0x28, + 0x8c, 0x5a, 0xa3, 0x24, 0x74, 0xf5, 0x98, 0x0b, 0x60, 0x0c, 0xda, 0xa4, 0x75, 0x11, 0xb7, 0xfc, + 0x83, 0xaf, 0xd9, 0x10, 0x7a, 0x6a, 0x83, 0xa5, 0x53, 0xee, 0x18, 0xb7, 0x3d, 0x3f, 0x6b, 0x36, + 0x83, 0x5e, 0x81, 0x4e, 0x2c, 0x84, 0x13, 0x71, 0x27, 0x09, 0xc6, 0xd1, 0xe4, 0x77, 0x6a, 0x91, + 0xf6, 0x48, 0xb9, 0x30, 0x2a, 0x37, 0x82, 0x44, 0x61, 0xd3, 0x1b, 0x41, 0x4e, 0x49, 0x65, 0x44, + 0xe9, 0x56, 0x75, 0x37, 0x3f, 0xff, 0x63, 0x09, 0x44, 0xda, 0x20, 0x09, 0xa7, 0x74, 0xb9, 0x5c, + 0xc4, 0x5d, 0xbf, 0xa2, 0x89, 0x46, 0x77, 0x30, 0x78, 0x6b, 0xcf, 0x1a, 0x96, 0x35, 0x33, 0xf3, + 0x1e, 0xa3, 0x49, 0x3f, 0xad, 0xb2, 0xbf, 0x60, 0xde, 0x8c, 0x75, 0x00, 0xad, 0xc7, 0xc3, 0xc9, + 0x72, 0x55, 0x4e, 0x96, 0x00, 0xdc, 0xc9, 0x35, 0xd2, 0x5e, 0x49, 0x64, 0x53, 0xf8, 0xd2, 0x5c, + 0xc2, 0xbe, 0xf9, 0x61, 0xef, 0x62, 0x1d, 0x7e, 0xff, 0x80, 0x5a, 0x33, 0x8b, 0xee, 0xc3, 0xb4, + 0x3a, 0xfc, 0x94, 0x9c, 0x7c, 0xe8, 0xfa, 0xab, 0xfe, 0x79, 0x09, 0x00, 0x00, 0xff, 0xff, 0x1a, + 0x27, 0x45, 0x90, 0x0e, 0x02, 0x00, 0x00, +} diff --git a/pkg/proto/rtc/rtc.proto b/pkg/proto/rtc/rtc.proto index 48ab8478c..f27a0b721 100644 --- a/pkg/proto/rtc/rtc.proto +++ b/pkg/proto/rtc/rtc.proto @@ -1,4 +1,5 @@ syntax = "proto3"; +import "Open_IM/pkg/proto/sdk_ws/ws.proto"; option go_package = "./rtc;rtc"; package rtc; @@ -12,7 +13,8 @@ message GetJoinTokenReq{ string apiSecret = 2; string room = 3; string identity = 4; - string operationID = 5; + server_api_params.ParticipantMetaData metaData = 5; + string operationID = 6; } message GetJoinTokenResp{ @@ -23,4 +25,3 @@ message GetJoinTokenResp{ service RtcService { rpc GetJoinToken(GetJoinTokenReq) returns(GetJoinTokenResp); } -