diff --git a/.gitignore b/.gitignore index cc006912e..d61f1a409 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ # Output of the go coverage tool, specifically when used with LiteIDE *.out livekit-server +proto/livekit # Dependency directories (remove the comment below to include it) # vendor/ diff --git a/magefile.go b/magefile.go index 06846afb7..23e6fa32d 100644 --- a/magefile.go +++ b/magefile.go @@ -211,7 +211,7 @@ func Generate() error { // code generation for wiring func generateWire() error { - mg.Deps(installDeps) + mg.Deps(installDeps, Proto) if !checksummer.IsChanged() { return nil } diff --git a/proto/livekit/internal.pb.go b/proto/livekit/internal.pb.go deleted file mode 100644 index 6f109c239..000000000 --- a/proto/livekit/internal.pb.go +++ /dev/null @@ -1,797 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.15.3 -// source: internal.proto - -package livekit - -import ( - 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) -) - -type Node struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` - NumCpus uint32 `protobuf:"varint,3,opt,name=num_cpus,json=numCpus,proto3" json:"num_cpus,omitempty"` - Stats *NodeStats `protobuf:"bytes,4,opt,name=stats,proto3" json:"stats,omitempty"` -} - -func (x *Node) Reset() { - *x = Node{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Node) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Node) ProtoMessage() {} - -func (x *Node) ProtoReflect() protoreflect.Message { - mi := &file_internal_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) -} - -// Deprecated: Use Node.ProtoReflect.Descriptor instead. -func (*Node) Descriptor() ([]byte, []int) { - return file_internal_proto_rawDescGZIP(), []int{0} -} - -func (x *Node) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Node) GetIp() string { - if x != nil { - return x.Ip - } - return "" -} - -func (x *Node) GetNumCpus() uint32 { - if x != nil { - return x.NumCpus - } - return 0 -} - -func (x *Node) GetStats() *NodeStats { - if x != nil { - return x.Stats - } - return nil -} - -type NodeStats struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // when server was started - StartedAt int64 `protobuf:"varint,1,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"` - // when server last reported its status - UpdatedAt int64 `protobuf:"varint,2,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - NumRooms uint32 `protobuf:"varint,3,opt,name=num_rooms,json=numRooms,proto3" json:"num_rooms,omitempty"` - NumClients uint32 `protobuf:"varint,4,opt,name=num_clients,json=numClients,proto3" json:"num_clients,omitempty"` - NumTracksIn uint32 `protobuf:"varint,5,opt,name=num_tracks_in,json=numTracksIn,proto3" json:"num_tracks_in,omitempty"` - NumTracksOut uint32 `protobuf:"varint,6,opt,name=num_tracks_out,json=numTracksOut,proto3" json:"num_tracks_out,omitempty"` -} - -func (x *NodeStats) Reset() { - *x = NodeStats{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NodeStats) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NodeStats) ProtoMessage() {} - -func (x *NodeStats) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_msgTypes[1] - 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 NodeStats.ProtoReflect.Descriptor instead. -func (*NodeStats) Descriptor() ([]byte, []int) { - return file_internal_proto_rawDescGZIP(), []int{1} -} - -func (x *NodeStats) GetStartedAt() int64 { - if x != nil { - return x.StartedAt - } - return 0 -} - -func (x *NodeStats) GetUpdatedAt() int64 { - if x != nil { - return x.UpdatedAt - } - return 0 -} - -func (x *NodeStats) GetNumRooms() uint32 { - if x != nil { - return x.NumRooms - } - return 0 -} - -func (x *NodeStats) GetNumClients() uint32 { - if x != nil { - return x.NumClients - } - return 0 -} - -func (x *NodeStats) GetNumTracksIn() uint32 { - if x != nil { - return x.NumTracksIn - } - return 0 -} - -func (x *NodeStats) GetNumTracksOut() uint32 { - if x != nil { - return x.NumTracksOut - } - return 0 -} - -// message to RTC nodes -type RTCNodeMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ParticipantKey string `protobuf:"bytes,1,opt,name=participant_key,json=participantKey,proto3" json:"participant_key,omitempty"` - // Types that are assignable to Message: - // *RTCNodeMessage_StartSession - // *RTCNodeMessage_Request - // *RTCNodeMessage_RemoveParticipant - // *RTCNodeMessage_MuteTrack - Message isRTCNodeMessage_Message `protobuf_oneof:"message"` -} - -func (x *RTCNodeMessage) Reset() { - *x = RTCNodeMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RTCNodeMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RTCNodeMessage) ProtoMessage() {} - -func (x *RTCNodeMessage) ProtoReflect() protoreflect.Message { - mi := &file_internal_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 RTCNodeMessage.ProtoReflect.Descriptor instead. -func (*RTCNodeMessage) Descriptor() ([]byte, []int) { - return file_internal_proto_rawDescGZIP(), []int{2} -} - -func (x *RTCNodeMessage) GetParticipantKey() string { - if x != nil { - return x.ParticipantKey - } - return "" -} - -func (m *RTCNodeMessage) GetMessage() isRTCNodeMessage_Message { - if m != nil { - return m.Message - } - return nil -} - -func (x *RTCNodeMessage) GetStartSession() *StartSession { - if x, ok := x.GetMessage().(*RTCNodeMessage_StartSession); ok { - return x.StartSession - } - return nil -} - -func (x *RTCNodeMessage) GetRequest() *SignalRequest { - if x, ok := x.GetMessage().(*RTCNodeMessage_Request); ok { - return x.Request - } - return nil -} - -func (x *RTCNodeMessage) GetRemoveParticipant() *RoomParticipantIdentity { - if x, ok := x.GetMessage().(*RTCNodeMessage_RemoveParticipant); ok { - return x.RemoveParticipant - } - return nil -} - -func (x *RTCNodeMessage) GetMuteTrack() *MuteRoomTrackRequest { - if x, ok := x.GetMessage().(*RTCNodeMessage_MuteTrack); ok { - return x.MuteTrack - } - return nil -} - -type isRTCNodeMessage_Message interface { - isRTCNodeMessage_Message() -} - -type RTCNodeMessage_StartSession struct { - StartSession *StartSession `protobuf:"bytes,2,opt,name=start_session,json=startSession,proto3,oneof"` -} - -type RTCNodeMessage_Request struct { - Request *SignalRequest `protobuf:"bytes,3,opt,name=request,proto3,oneof"` -} - -type RTCNodeMessage_RemoveParticipant struct { - // internal messages - RemoveParticipant *RoomParticipantIdentity `protobuf:"bytes,4,opt,name=remove_participant,json=removeParticipant,proto3,oneof"` -} - -type RTCNodeMessage_MuteTrack struct { - MuteTrack *MuteRoomTrackRequest `protobuf:"bytes,5,opt,name=mute_track,json=muteTrack,proto3,oneof"` -} - -func (*RTCNodeMessage_StartSession) isRTCNodeMessage_Message() {} - -func (*RTCNodeMessage_Request) isRTCNodeMessage_Message() {} - -func (*RTCNodeMessage_RemoveParticipant) isRTCNodeMessage_Message() {} - -func (*RTCNodeMessage_MuteTrack) isRTCNodeMessage_Message() {} - -// message to Signal nodes -type SignalNodeMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ConnectionId string `protobuf:"bytes,1,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"` - // Types that are assignable to Message: - // *SignalNodeMessage_Response - // *SignalNodeMessage_EndSession - Message isSignalNodeMessage_Message `protobuf_oneof:"message"` -} - -func (x *SignalNodeMessage) Reset() { - *x = SignalNodeMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignalNodeMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignalNodeMessage) ProtoMessage() {} - -func (x *SignalNodeMessage) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_msgTypes[3] - 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 SignalNodeMessage.ProtoReflect.Descriptor instead. -func (*SignalNodeMessage) Descriptor() ([]byte, []int) { - return file_internal_proto_rawDescGZIP(), []int{3} -} - -func (x *SignalNodeMessage) GetConnectionId() string { - if x != nil { - return x.ConnectionId - } - return "" -} - -func (m *SignalNodeMessage) GetMessage() isSignalNodeMessage_Message { - if m != nil { - return m.Message - } - return nil -} - -func (x *SignalNodeMessage) GetResponse() *SignalResponse { - if x, ok := x.GetMessage().(*SignalNodeMessage_Response); ok { - return x.Response - } - return nil -} - -func (x *SignalNodeMessage) GetEndSession() *EndSession { - if x, ok := x.GetMessage().(*SignalNodeMessage_EndSession); ok { - return x.EndSession - } - return nil -} - -type isSignalNodeMessage_Message interface { - isSignalNodeMessage_Message() -} - -type SignalNodeMessage_Response struct { - Response *SignalResponse `protobuf:"bytes,2,opt,name=response,proto3,oneof"` -} - -type SignalNodeMessage_EndSession struct { - EndSession *EndSession `protobuf:"bytes,3,opt,name=end_session,json=endSession,proto3,oneof"` -} - -func (*SignalNodeMessage_Response) isSignalNodeMessage_Message() {} - -func (*SignalNodeMessage_EndSession) isSignalNodeMessage_Message() {} - -type StartSession struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RoomName string `protobuf:"bytes,1,opt,name=room_name,json=roomName,proto3" json:"room_name,omitempty"` - Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` - ConnectionId string `protobuf:"bytes,3,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"` - // if a client is reconnecting (i.e. resume instead of restart) - Reconnect bool `protobuf:"varint,4,opt,name=reconnect,proto3" json:"reconnect,omitempty"` - // metadata to pass to participant - Metadata string `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` -} - -func (x *StartSession) Reset() { - *x = StartSession{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StartSession) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartSession) ProtoMessage() {} - -func (x *StartSession) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_msgTypes[4] - 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 StartSession.ProtoReflect.Descriptor instead. -func (*StartSession) Descriptor() ([]byte, []int) { - return file_internal_proto_rawDescGZIP(), []int{4} -} - -func (x *StartSession) GetRoomName() string { - if x != nil { - return x.RoomName - } - return "" -} - -func (x *StartSession) GetIdentity() string { - if x != nil { - return x.Identity - } - return "" -} - -func (x *StartSession) GetConnectionId() string { - if x != nil { - return x.ConnectionId - } - return "" -} - -func (x *StartSession) GetReconnect() bool { - if x != nil { - return x.Reconnect - } - return false -} - -func (x *StartSession) GetMetadata() string { - if x != nil { - return x.Metadata - } - return "" -} - -type EndSession struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *EndSession) Reset() { - *x = EndSession{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EndSession) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EndSession) ProtoMessage() {} - -func (x *EndSession) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_msgTypes[5] - 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 EndSession.ProtoReflect.Descriptor instead. -func (*EndSession) Descriptor() ([]byte, []int) { - return file_internal_proto_rawDescGZIP(), []int{5} -} - -type RemoveParticipant struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ParticipantId string `protobuf:"bytes,1,opt,name=participant_id,json=participantId,proto3" json:"participant_id,omitempty"` -} - -func (x *RemoveParticipant) Reset() { - *x = RemoveParticipant{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveParticipant) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveParticipant) ProtoMessage() {} - -func (x *RemoveParticipant) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_msgTypes[6] - 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 RemoveParticipant.ProtoReflect.Descriptor instead. -func (*RemoveParticipant) Descriptor() ([]byte, []int) { - return file_internal_proto_rawDescGZIP(), []int{6} -} - -func (x *RemoveParticipant) GetParticipantId() string { - if x != nil { - return x.ParticipantId - } - return "" -} - -var File_internal_proto protoreflect.FileDescriptor - -var file_internal_proto_rawDesc = []byte{ - 0x0a, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x07, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x1a, 0x09, 0x72, 0x74, 0x63, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x72, 0x6f, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x6b, 0x0a, 0x04, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x75, 0x6d, 0x5f, - 0x63, 0x70, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x6e, 0x75, 0x6d, 0x43, - 0x70, 0x75, 0x73, 0x12, 0x28, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4e, 0x6f, 0x64, - 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x22, 0xd1, 0x01, - 0x0a, 0x09, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x75, 0x6d, - 0x5f, 0x72, 0x6f, 0x6f, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x6e, 0x75, - 0x6d, 0x52, 0x6f, 0x6f, 0x6d, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6e, 0x75, 0x6d, - 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x6e, 0x75, 0x6d, 0x5f, 0x74, - 0x72, 0x61, 0x63, 0x6b, 0x73, 0x5f, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, - 0x6e, 0x75, 0x6d, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x73, 0x49, 0x6e, 0x12, 0x24, 0x0a, 0x0e, 0x6e, - 0x75, 0x6d, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x73, 0x5f, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x6e, 0x75, 0x6d, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x73, 0x4f, 0x75, - 0x74, 0x22, 0xc9, 0x02, 0x0a, 0x0e, 0x52, 0x54, 0x43, 0x4e, 0x6f, 0x64, 0x65, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, - 0x61, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, - 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x3c, 0x0a, - 0x0d, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, - 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0c, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x07, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6c, - 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x51, 0x0a, 0x12, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, - 0x69, 0x70, 0x61, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6c, 0x69, - 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, - 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x48, 0x00, 0x52, - 0x11, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, - 0x6e, 0x74, 0x12, 0x3e, 0x0a, 0x0a, 0x6d, 0x75, 0x74, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x6b, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, - 0x2e, 0x4d, 0x75, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x6d, 0x75, 0x74, 0x65, 0x54, 0x72, 0x61, - 0x63, 0x6b, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xb2, 0x01, - 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6c, 0x69, 0x76, - 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x36, 0x0a, 0x0b, 0x65, 0x6e, 0x64, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x45, - 0x6e, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0a, 0x65, 0x6e, 0x64, - 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x22, 0xa6, 0x01, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x23, 0x0a, 0x0d, - 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, - 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x0c, 0x0a, 0x0a, 0x45, - 0x6e, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x3a, 0x0a, 0x11, 0x52, 0x65, 0x6d, - 0x6f, 0x76, 0x65, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x25, - 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, - 0x61, 0x6e, 0x74, 0x49, 0x64, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2f, 0x6c, 0x69, 0x76, 0x65, - 0x6b, 0x69, 0x74, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_internal_proto_rawDescOnce sync.Once - file_internal_proto_rawDescData = file_internal_proto_rawDesc -) - -func file_internal_proto_rawDescGZIP() []byte { - file_internal_proto_rawDescOnce.Do(func() { - file_internal_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_proto_rawDescData) - }) - return file_internal_proto_rawDescData -} - -var file_internal_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_internal_proto_goTypes = []interface{}{ - (*Node)(nil), // 0: livekit.Node - (*NodeStats)(nil), // 1: livekit.NodeStats - (*RTCNodeMessage)(nil), // 2: livekit.RTCNodeMessage - (*SignalNodeMessage)(nil), // 3: livekit.SignalNodeMessage - (*StartSession)(nil), // 4: livekit.StartSession - (*EndSession)(nil), // 5: livekit.EndSession - (*RemoveParticipant)(nil), // 6: livekit.RemoveParticipant - (*SignalRequest)(nil), // 7: livekit.SignalRequest - (*RoomParticipantIdentity)(nil), // 8: livekit.RoomParticipantIdentity - (*MuteRoomTrackRequest)(nil), // 9: livekit.MuteRoomTrackRequest - (*SignalResponse)(nil), // 10: livekit.SignalResponse -} -var file_internal_proto_depIdxs = []int32{ - 1, // 0: livekit.Node.stats:type_name -> livekit.NodeStats - 4, // 1: livekit.RTCNodeMessage.start_session:type_name -> livekit.StartSession - 7, // 2: livekit.RTCNodeMessage.request:type_name -> livekit.SignalRequest - 8, // 3: livekit.RTCNodeMessage.remove_participant:type_name -> livekit.RoomParticipantIdentity - 9, // 4: livekit.RTCNodeMessage.mute_track:type_name -> livekit.MuteRoomTrackRequest - 10, // 5: livekit.SignalNodeMessage.response:type_name -> livekit.SignalResponse - 5, // 6: livekit.SignalNodeMessage.end_session:type_name -> livekit.EndSession - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name -} - -func init() { file_internal_proto_init() } -func file_internal_proto_init() { - if File_internal_proto != nil { - return - } - file_rtc_proto_init() - file_room_proto_init() - if !protoimpl.UnsafeEnabled { - file_internal_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Node); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NodeStats); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RTCNodeMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignalNodeMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StartSession); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EndSession); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveParticipant); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_internal_proto_msgTypes[2].OneofWrappers = []interface{}{ - (*RTCNodeMessage_StartSession)(nil), - (*RTCNodeMessage_Request)(nil), - (*RTCNodeMessage_RemoveParticipant)(nil), - (*RTCNodeMessage_MuteTrack)(nil), - } - file_internal_proto_msgTypes[3].OneofWrappers = []interface{}{ - (*SignalNodeMessage_Response)(nil), - (*SignalNodeMessage_EndSession)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_internal_proto_rawDesc, - NumEnums: 0, - NumMessages: 7, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_internal_proto_goTypes, - DependencyIndexes: file_internal_proto_depIdxs, - MessageInfos: file_internal_proto_msgTypes, - }.Build() - File_internal_proto = out.File - file_internal_proto_rawDesc = nil - file_internal_proto_goTypes = nil - file_internal_proto_depIdxs = nil -} diff --git a/proto/livekit/model.pb.go b/proto/livekit/model.pb.go deleted file mode 100644 index caab123a9..000000000 --- a/proto/livekit/model.pb.go +++ /dev/null @@ -1,609 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.15.3 -// source: model.proto - -package livekit - -import ( - 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) -) - -type TrackType int32 - -const ( - TrackType_AUDIO TrackType = 0 - TrackType_VIDEO TrackType = 1 - TrackType_DATA TrackType = 2 -) - -// Enum value maps for TrackType. -var ( - TrackType_name = map[int32]string{ - 0: "AUDIO", - 1: "VIDEO", - 2: "DATA", - } - TrackType_value = map[string]int32{ - "AUDIO": 0, - "VIDEO": 1, - "DATA": 2, - } -) - -func (x TrackType) Enum() *TrackType { - p := new(TrackType) - *p = x - return p -} - -func (x TrackType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (TrackType) Descriptor() protoreflect.EnumDescriptor { - return file_model_proto_enumTypes[0].Descriptor() -} - -func (TrackType) Type() protoreflect.EnumType { - return &file_model_proto_enumTypes[0] -} - -func (x TrackType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use TrackType.Descriptor instead. -func (TrackType) EnumDescriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{0} -} - -type ParticipantInfo_State int32 - -const ( - // websocket' connected, but not offered yet - ParticipantInfo_JOINING ParticipantInfo_State = 0 - // server received client offer - ParticipantInfo_JOINED ParticipantInfo_State = 1 - // ICE connectivity established - ParticipantInfo_ACTIVE ParticipantInfo_State = 2 - // WS disconnected - ParticipantInfo_DISCONNECTED ParticipantInfo_State = 3 -) - -// Enum value maps for ParticipantInfo_State. -var ( - ParticipantInfo_State_name = map[int32]string{ - 0: "JOINING", - 1: "JOINED", - 2: "ACTIVE", - 3: "DISCONNECTED", - } - ParticipantInfo_State_value = map[string]int32{ - "JOINING": 0, - "JOINED": 1, - "ACTIVE": 2, - "DISCONNECTED": 3, - } -) - -func (x ParticipantInfo_State) Enum() *ParticipantInfo_State { - p := new(ParticipantInfo_State) - *p = x - return p -} - -func (x ParticipantInfo_State) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ParticipantInfo_State) Descriptor() protoreflect.EnumDescriptor { - return file_model_proto_enumTypes[1].Descriptor() -} - -func (ParticipantInfo_State) Type() protoreflect.EnumType { - return &file_model_proto_enumTypes[1] -} - -func (x ParticipantInfo_State) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ParticipantInfo_State.Descriptor instead. -func (ParticipantInfo_State) EnumDescriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{1, 0} -} - -type Room struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - EmptyTimeout uint32 `protobuf:"varint,3,opt,name=empty_timeout,json=emptyTimeout,proto3" json:"empty_timeout,omitempty"` - MaxParticipants uint32 `protobuf:"varint,4,opt,name=max_participants,json=maxParticipants,proto3" json:"max_participants,omitempty"` - CreationTime int64 `protobuf:"varint,5,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"` - TurnPassword string `protobuf:"bytes,6,opt,name=turn_password,json=turnPassword,proto3" json:"turn_password,omitempty"` -} - -func (x *Room) Reset() { - *x = Room{} - if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Room) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Room) ProtoMessage() {} - -func (x *Room) ProtoReflect() protoreflect.Message { - mi := &file_model_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) -} - -// Deprecated: Use Room.ProtoReflect.Descriptor instead. -func (*Room) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{0} -} - -func (x *Room) GetSid() string { - if x != nil { - return x.Sid - } - return "" -} - -func (x *Room) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Room) GetEmptyTimeout() uint32 { - if x != nil { - return x.EmptyTimeout - } - return 0 -} - -func (x *Room) GetMaxParticipants() uint32 { - if x != nil { - return x.MaxParticipants - } - return 0 -} - -func (x *Room) GetCreationTime() int64 { - if x != nil { - return x.CreationTime - } - return 0 -} - -func (x *Room) GetTurnPassword() string { - if x != nil { - return x.TurnPassword - } - return "" -} - -type ParticipantInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"` - Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` - State ParticipantInfo_State `protobuf:"varint,3,opt,name=state,proto3,enum=livekit.ParticipantInfo_State" json:"state,omitempty"` - Tracks []*TrackInfo `protobuf:"bytes,4,rep,name=tracks,proto3" json:"tracks,omitempty"` - Metadata string `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` -} - -func (x *ParticipantInfo) Reset() { - *x = ParticipantInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ParticipantInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ParticipantInfo) ProtoMessage() {} - -func (x *ParticipantInfo) ProtoReflect() protoreflect.Message { - mi := &file_model_proto_msgTypes[1] - 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 ParticipantInfo.ProtoReflect.Descriptor instead. -func (*ParticipantInfo) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{1} -} - -func (x *ParticipantInfo) GetSid() string { - if x != nil { - return x.Sid - } - return "" -} - -func (x *ParticipantInfo) GetIdentity() string { - if x != nil { - return x.Identity - } - return "" -} - -func (x *ParticipantInfo) GetState() ParticipantInfo_State { - if x != nil { - return x.State - } - return ParticipantInfo_JOINING -} - -func (x *ParticipantInfo) GetTracks() []*TrackInfo { - if x != nil { - return x.Tracks - } - return nil -} - -func (x *ParticipantInfo) GetMetadata() string { - if x != nil { - return x.Metadata - } - return "" -} - -type TrackInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"` - Type TrackType `protobuf:"varint,2,opt,name=type,proto3,enum=livekit.TrackType" json:"type,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Muted bool `protobuf:"varint,4,opt,name=muted,proto3" json:"muted,omitempty"` -} - -func (x *TrackInfo) Reset() { - *x = TrackInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TrackInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TrackInfo) ProtoMessage() {} - -func (x *TrackInfo) ProtoReflect() protoreflect.Message { - mi := &file_model_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 TrackInfo.ProtoReflect.Descriptor instead. -func (*TrackInfo) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{2} -} - -func (x *TrackInfo) GetSid() string { - if x != nil { - return x.Sid - } - return "" -} - -func (x *TrackInfo) GetType() TrackType { - if x != nil { - return x.Type - } - return TrackType_AUDIO -} - -func (x *TrackInfo) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *TrackInfo) GetMuted() bool { - if x != nil { - return x.Muted - } - return false -} - -type DataMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Value: - // *DataMessage_Text - // *DataMessage_Binary - Value isDataMessage_Value `protobuf_oneof:"value"` -} - -func (x *DataMessage) Reset() { - *x = DataMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_model_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DataMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage) ProtoMessage() {} - -func (x *DataMessage) ProtoReflect() protoreflect.Message { - mi := &file_model_proto_msgTypes[3] - 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 DataMessage.ProtoReflect.Descriptor instead. -func (*DataMessage) Descriptor() ([]byte, []int) { - return file_model_proto_rawDescGZIP(), []int{3} -} - -func (m *DataMessage) GetValue() isDataMessage_Value { - if m != nil { - return m.Value - } - return nil -} - -func (x *DataMessage) GetText() string { - if x, ok := x.GetValue().(*DataMessage_Text); ok { - return x.Text - } - return "" -} - -func (x *DataMessage) GetBinary() []byte { - if x, ok := x.GetValue().(*DataMessage_Binary); ok { - return x.Binary - } - return nil -} - -type isDataMessage_Value interface { - isDataMessage_Value() -} - -type DataMessage_Text struct { - Text string `protobuf:"bytes,1,opt,name=text,proto3,oneof"` -} - -type DataMessage_Binary struct { - Binary []byte `protobuf:"bytes,2,opt,name=binary,proto3,oneof"` -} - -func (*DataMessage_Text) isDataMessage_Value() {} - -func (*DataMessage_Binary) isDataMessage_Value() {} - -var File_model_proto protoreflect.FileDescriptor - -var file_model_proto_rawDesc = []byte{ - 0x0a, 0x0b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6c, - 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x22, 0xc6, 0x01, 0x0a, 0x04, 0x52, 0x6f, 0x6f, 0x6d, 0x12, - 0x10, 0x0a, 0x03, 0x73, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x69, - 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x65, 0x6d, - 0x70, 0x74, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x6d, 0x61, - 0x78, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x6d, 0x61, 0x78, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, - 0x70, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x75, - 0x72, 0x6e, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x74, 0x75, 0x72, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, - 0xfd, 0x01, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, - 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x73, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x12, 0x34, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x1e, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, - 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x63, 0x6b, - 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, - 0x74, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x74, 0x72, 0x61, - 0x63, 0x6b, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, - 0x3e, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x4a, 0x4f, 0x49, 0x4e, - 0x49, 0x4e, 0x47, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4a, 0x4f, 0x49, 0x4e, 0x45, 0x44, 0x10, - 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x02, 0x12, 0x10, 0x0a, - 0x0c, 0x44, 0x49, 0x53, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x03, 0x22, - 0x6f, 0x0a, 0x09, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, - 0x73, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x69, 0x64, 0x12, 0x26, - 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x6c, - 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x75, - 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x6d, 0x75, 0x74, 0x65, 0x64, - 0x22, 0x46, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, - 0x14, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, - 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x18, 0x0a, 0x06, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x06, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x42, - 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2a, 0x2b, 0x0a, 0x09, 0x54, 0x72, 0x61, 0x63, - 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x55, 0x44, 0x49, 0x4f, 0x10, 0x00, - 0x12, 0x09, 0x0a, 0x05, 0x56, 0x49, 0x44, 0x45, 0x4f, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x44, - 0x41, 0x54, 0x41, 0x10, 0x02, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2f, 0x6c, 0x69, 0x76, 0x65, - 0x6b, 0x69, 0x74, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_model_proto_rawDescOnce sync.Once - file_model_proto_rawDescData = file_model_proto_rawDesc -) - -func file_model_proto_rawDescGZIP() []byte { - file_model_proto_rawDescOnce.Do(func() { - file_model_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_proto_rawDescData) - }) - return file_model_proto_rawDescData -} - -var file_model_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_model_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_model_proto_goTypes = []interface{}{ - (TrackType)(0), // 0: livekit.TrackType - (ParticipantInfo_State)(0), // 1: livekit.ParticipantInfo.State - (*Room)(nil), // 2: livekit.Room - (*ParticipantInfo)(nil), // 3: livekit.ParticipantInfo - (*TrackInfo)(nil), // 4: livekit.TrackInfo - (*DataMessage)(nil), // 5: livekit.DataMessage -} -var file_model_proto_depIdxs = []int32{ - 1, // 0: livekit.ParticipantInfo.state:type_name -> livekit.ParticipantInfo.State - 4, // 1: livekit.ParticipantInfo.tracks:type_name -> livekit.TrackInfo - 0, // 2: livekit.TrackInfo.type:type_name -> livekit.TrackType - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] 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_model_proto_init() } -func file_model_proto_init() { - if File_model_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_model_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Room); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_model_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ParticipantInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_model_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TrackInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_model_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DataMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_model_proto_msgTypes[3].OneofWrappers = []interface{}{ - (*DataMessage_Text)(nil), - (*DataMessage_Binary)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_model_proto_rawDesc, - NumEnums: 2, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_model_proto_goTypes, - DependencyIndexes: file_model_proto_depIdxs, - EnumInfos: file_model_proto_enumTypes, - MessageInfos: file_model_proto_msgTypes, - }.Build() - File_model_proto = out.File - file_model_proto_rawDesc = nil - file_model_proto_goTypes = nil - file_model_proto_depIdxs = nil -} diff --git a/proto/livekit/room.pb.go b/proto/livekit/room.pb.go deleted file mode 100644 index 8bfe263ca..000000000 --- a/proto/livekit/room.pb.go +++ /dev/null @@ -1,874 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.15.3 -// source: room.proto - -package livekit - -import ( - 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) -) - -type CreateRoomRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // number of seconds the room should cleanup after being empty - EmptyTimeout uint32 `protobuf:"varint,2,opt,name=empty_timeout,json=emptyTimeout,proto3" json:"empty_timeout,omitempty"` - MaxParticipants uint32 `protobuf:"varint,3,opt,name=max_participants,json=maxParticipants,proto3" json:"max_participants,omitempty"` - // override the node room is allocated to, for debugging - NodeId string `protobuf:"bytes,4,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` -} - -func (x *CreateRoomRequest) Reset() { - *x = CreateRoomRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_room_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateRoomRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateRoomRequest) ProtoMessage() {} - -func (x *CreateRoomRequest) ProtoReflect() protoreflect.Message { - mi := &file_room_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) -} - -// Deprecated: Use CreateRoomRequest.ProtoReflect.Descriptor instead. -func (*CreateRoomRequest) Descriptor() ([]byte, []int) { - return file_room_proto_rawDescGZIP(), []int{0} -} - -func (x *CreateRoomRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CreateRoomRequest) GetEmptyTimeout() uint32 { - if x != nil { - return x.EmptyTimeout - } - return 0 -} - -func (x *CreateRoomRequest) GetMaxParticipants() uint32 { - if x != nil { - return x.MaxParticipants - } - return 0 -} - -func (x *CreateRoomRequest) GetNodeId() string { - if x != nil { - return x.NodeId - } - return "" -} - -type ListRoomsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ListRoomsRequest) Reset() { - *x = ListRoomsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_room_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRoomsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRoomsRequest) ProtoMessage() {} - -func (x *ListRoomsRequest) ProtoReflect() protoreflect.Message { - mi := &file_room_proto_msgTypes[1] - 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 ListRoomsRequest.ProtoReflect.Descriptor instead. -func (*ListRoomsRequest) Descriptor() ([]byte, []int) { - return file_room_proto_rawDescGZIP(), []int{1} -} - -type ListRoomsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Rooms []*Room `protobuf:"bytes,1,rep,name=rooms,proto3" json:"rooms,omitempty"` -} - -func (x *ListRoomsResponse) Reset() { - *x = ListRoomsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_room_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRoomsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRoomsResponse) ProtoMessage() {} - -func (x *ListRoomsResponse) ProtoReflect() protoreflect.Message { - mi := &file_room_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 ListRoomsResponse.ProtoReflect.Descriptor instead. -func (*ListRoomsResponse) Descriptor() ([]byte, []int) { - return file_room_proto_rawDescGZIP(), []int{2} -} - -func (x *ListRoomsResponse) GetRooms() []*Room { - if x != nil { - return x.Rooms - } - return nil -} - -type DeleteRoomRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Room string `protobuf:"bytes,1,opt,name=room,proto3" json:"room,omitempty"` -} - -func (x *DeleteRoomRequest) Reset() { - *x = DeleteRoomRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_room_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteRoomRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRoomRequest) ProtoMessage() {} - -func (x *DeleteRoomRequest) ProtoReflect() protoreflect.Message { - mi := &file_room_proto_msgTypes[3] - 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 DeleteRoomRequest.ProtoReflect.Descriptor instead. -func (*DeleteRoomRequest) Descriptor() ([]byte, []int) { - return file_room_proto_rawDescGZIP(), []int{3} -} - -func (x *DeleteRoomRequest) GetRoom() string { - if x != nil { - return x.Room - } - return "" -} - -type DeleteRoomResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteRoomResponse) Reset() { - *x = DeleteRoomResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_room_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteRoomResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRoomResponse) ProtoMessage() {} - -func (x *DeleteRoomResponse) ProtoReflect() protoreflect.Message { - mi := &file_room_proto_msgTypes[4] - 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 DeleteRoomResponse.ProtoReflect.Descriptor instead. -func (*DeleteRoomResponse) Descriptor() ([]byte, []int) { - return file_room_proto_rawDescGZIP(), []int{4} -} - -type ListParticipantsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Room string `protobuf:"bytes,1,opt,name=room,proto3" json:"room,omitempty"` -} - -func (x *ListParticipantsRequest) Reset() { - *x = ListParticipantsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_room_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListParticipantsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListParticipantsRequest) ProtoMessage() {} - -func (x *ListParticipantsRequest) ProtoReflect() protoreflect.Message { - mi := &file_room_proto_msgTypes[5] - 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 ListParticipantsRequest.ProtoReflect.Descriptor instead. -func (*ListParticipantsRequest) Descriptor() ([]byte, []int) { - return file_room_proto_rawDescGZIP(), []int{5} -} - -func (x *ListParticipantsRequest) GetRoom() string { - if x != nil { - return x.Room - } - return "" -} - -type ListParticipantsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Participants []*ParticipantInfo `protobuf:"bytes,1,rep,name=participants,proto3" json:"participants,omitempty"` -} - -func (x *ListParticipantsResponse) Reset() { - *x = ListParticipantsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_room_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListParticipantsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListParticipantsResponse) ProtoMessage() {} - -func (x *ListParticipantsResponse) ProtoReflect() protoreflect.Message { - mi := &file_room_proto_msgTypes[6] - 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 ListParticipantsResponse.ProtoReflect.Descriptor instead. -func (*ListParticipantsResponse) Descriptor() ([]byte, []int) { - return file_room_proto_rawDescGZIP(), []int{6} -} - -func (x *ListParticipantsResponse) GetParticipants() []*ParticipantInfo { - if x != nil { - return x.Participants - } - return nil -} - -type RoomParticipantIdentity struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Room string `protobuf:"bytes,1,opt,name=room,proto3" json:"room,omitempty"` - Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` -} - -func (x *RoomParticipantIdentity) Reset() { - *x = RoomParticipantIdentity{} - if protoimpl.UnsafeEnabled { - mi := &file_room_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RoomParticipantIdentity) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RoomParticipantIdentity) ProtoMessage() {} - -func (x *RoomParticipantIdentity) ProtoReflect() protoreflect.Message { - mi := &file_room_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 RoomParticipantIdentity.ProtoReflect.Descriptor instead. -func (*RoomParticipantIdentity) Descriptor() ([]byte, []int) { - return file_room_proto_rawDescGZIP(), []int{7} -} - -func (x *RoomParticipantIdentity) GetRoom() string { - if x != nil { - return x.Room - } - return "" -} - -func (x *RoomParticipantIdentity) GetIdentity() string { - if x != nil { - return x.Identity - } - return "" -} - -type RemoveParticipantResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RemoveParticipantResponse) Reset() { - *x = RemoveParticipantResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_room_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveParticipantResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveParticipantResponse) ProtoMessage() {} - -func (x *RemoveParticipantResponse) ProtoReflect() protoreflect.Message { - mi := &file_room_proto_msgTypes[8] - 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 RemoveParticipantResponse.ProtoReflect.Descriptor instead. -func (*RemoveParticipantResponse) Descriptor() ([]byte, []int) { - return file_room_proto_rawDescGZIP(), []int{8} -} - -type MuteRoomTrackRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Room string `protobuf:"bytes,1,opt,name=room,proto3" json:"room,omitempty"` - Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` - TrackSid string `protobuf:"bytes,3,opt,name=track_sid,json=trackSid,proto3" json:"track_sid,omitempty"` - Muted bool `protobuf:"varint,4,opt,name=muted,proto3" json:"muted,omitempty"` -} - -func (x *MuteRoomTrackRequest) Reset() { - *x = MuteRoomTrackRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_room_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MuteRoomTrackRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MuteRoomTrackRequest) ProtoMessage() {} - -func (x *MuteRoomTrackRequest) ProtoReflect() protoreflect.Message { - mi := &file_room_proto_msgTypes[9] - 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 MuteRoomTrackRequest.ProtoReflect.Descriptor instead. -func (*MuteRoomTrackRequest) Descriptor() ([]byte, []int) { - return file_room_proto_rawDescGZIP(), []int{9} -} - -func (x *MuteRoomTrackRequest) GetRoom() string { - if x != nil { - return x.Room - } - return "" -} - -func (x *MuteRoomTrackRequest) GetIdentity() string { - if x != nil { - return x.Identity - } - return "" -} - -func (x *MuteRoomTrackRequest) GetTrackSid() string { - if x != nil { - return x.TrackSid - } - return "" -} - -func (x *MuteRoomTrackRequest) GetMuted() bool { - if x != nil { - return x.Muted - } - return false -} - -type MuteRoomTrackResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Track *TrackInfo `protobuf:"bytes,1,opt,name=track,proto3" json:"track,omitempty"` -} - -func (x *MuteRoomTrackResponse) Reset() { - *x = MuteRoomTrackResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_room_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MuteRoomTrackResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MuteRoomTrackResponse) ProtoMessage() {} - -func (x *MuteRoomTrackResponse) ProtoReflect() protoreflect.Message { - mi := &file_room_proto_msgTypes[10] - 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 MuteRoomTrackResponse.ProtoReflect.Descriptor instead. -func (*MuteRoomTrackResponse) Descriptor() ([]byte, []int) { - return file_room_proto_rawDescGZIP(), []int{10} -} - -func (x *MuteRoomTrackResponse) GetTrack() *TrackInfo { - if x != nil { - return x.Track - } - return nil -} - -var File_room_proto protoreflect.FileDescriptor - -var file_room_proto_rawDesc = []byte{ - 0x0a, 0x0a, 0x72, 0x6f, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6c, 0x69, - 0x76, 0x65, 0x6b, 0x69, 0x74, 0x1a, 0x0b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x90, 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, - 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, - 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, - 0x74, 0x12, 0x29, 0x0a, 0x10, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, - 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x6d, 0x61, 0x78, - 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x17, 0x0a, 0x07, - 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, - 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0x12, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6f, - 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x38, 0x0a, 0x11, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, - 0x0a, 0x05, 0x72, 0x6f, 0x6f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, - 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x52, 0x05, 0x72, 0x6f, - 0x6f, 0x6d, 0x73, 0x22, 0x27, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6f, - 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x6d, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x6d, 0x22, 0x14, 0x0a, 0x12, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x2d, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, - 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x72, 0x6f, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6f, - 0x6d, 0x22, 0x58, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, - 0x70, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, - 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x50, 0x61, - 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0c, 0x70, - 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x22, 0x49, 0x0a, 0x17, 0x52, - 0x6f, 0x6f, 0x6d, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x6d, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x22, 0x1b, 0x0a, 0x19, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, - 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x79, 0x0a, 0x14, 0x4d, 0x75, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x54, - 0x72, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x72, - 0x6f, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x6d, 0x12, - 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x74, - 0x72, 0x61, 0x63, 0x6b, 0x5f, 0x73, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x74, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x75, 0x74, 0x65, - 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x6d, 0x75, 0x74, 0x65, 0x64, 0x22, 0x41, - 0x0a, 0x15, 0x4d, 0x75, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x74, 0x72, 0x61, 0x63, 0x6b, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, - 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x74, 0x72, 0x61, 0x63, - 0x6b, 0x32, 0xa8, 0x04, 0x0a, 0x0b, 0x52, 0x6f, 0x6f, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x12, - 0x1a, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x52, 0x6f, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x6c, 0x69, - 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x12, 0x42, 0x0a, 0x09, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x73, 0x12, 0x19, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, - 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, - 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x12, 0x1a, 0x2e, 0x6c, - 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6f, - 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, - 0x69, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, - 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x20, 0x2e, 0x6c, 0x69, 0x76, 0x65, - 0x6b, 0x69, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, - 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6c, 0x69, - 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, - 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, - 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, - 0x12, 0x20, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x50, - 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x1a, 0x18, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x50, 0x61, 0x72, - 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x59, 0x0a, 0x11, - 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, - 0x74, 0x12, 0x20, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, - 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x1a, 0x22, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x52, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x12, 0x4d, 0x75, 0x74, 0x65, 0x50, - 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x12, 0x1d, 0x2e, - 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4d, 0x75, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x6d, - 0x54, 0x72, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6c, - 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4d, 0x75, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x54, - 0x72, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x31, 0x5a, 0x2f, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, - 0x69, 0x74, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_room_proto_rawDescOnce sync.Once - file_room_proto_rawDescData = file_room_proto_rawDesc -) - -func file_room_proto_rawDescGZIP() []byte { - file_room_proto_rawDescOnce.Do(func() { - file_room_proto_rawDescData = protoimpl.X.CompressGZIP(file_room_proto_rawDescData) - }) - return file_room_proto_rawDescData -} - -var file_room_proto_msgTypes = make([]protoimpl.MessageInfo, 11) -var file_room_proto_goTypes = []interface{}{ - (*CreateRoomRequest)(nil), // 0: livekit.CreateRoomRequest - (*ListRoomsRequest)(nil), // 1: livekit.ListRoomsRequest - (*ListRoomsResponse)(nil), // 2: livekit.ListRoomsResponse - (*DeleteRoomRequest)(nil), // 3: livekit.DeleteRoomRequest - (*DeleteRoomResponse)(nil), // 4: livekit.DeleteRoomResponse - (*ListParticipantsRequest)(nil), // 5: livekit.ListParticipantsRequest - (*ListParticipantsResponse)(nil), // 6: livekit.ListParticipantsResponse - (*RoomParticipantIdentity)(nil), // 7: livekit.RoomParticipantIdentity - (*RemoveParticipantResponse)(nil), // 8: livekit.RemoveParticipantResponse - (*MuteRoomTrackRequest)(nil), // 9: livekit.MuteRoomTrackRequest - (*MuteRoomTrackResponse)(nil), // 10: livekit.MuteRoomTrackResponse - (*Room)(nil), // 11: livekit.Room - (*ParticipantInfo)(nil), // 12: livekit.ParticipantInfo - (*TrackInfo)(nil), // 13: livekit.TrackInfo -} -var file_room_proto_depIdxs = []int32{ - 11, // 0: livekit.ListRoomsResponse.rooms:type_name -> livekit.Room - 12, // 1: livekit.ListParticipantsResponse.participants:type_name -> livekit.ParticipantInfo - 13, // 2: livekit.MuteRoomTrackResponse.track:type_name -> livekit.TrackInfo - 0, // 3: livekit.RoomService.CreateRoom:input_type -> livekit.CreateRoomRequest - 1, // 4: livekit.RoomService.ListRooms:input_type -> livekit.ListRoomsRequest - 3, // 5: livekit.RoomService.DeleteRoom:input_type -> livekit.DeleteRoomRequest - 5, // 6: livekit.RoomService.ListParticipants:input_type -> livekit.ListParticipantsRequest - 7, // 7: livekit.RoomService.GetParticipant:input_type -> livekit.RoomParticipantIdentity - 7, // 8: livekit.RoomService.RemoveParticipant:input_type -> livekit.RoomParticipantIdentity - 9, // 9: livekit.RoomService.MutePublishedTrack:input_type -> livekit.MuteRoomTrackRequest - 11, // 10: livekit.RoomService.CreateRoom:output_type -> livekit.Room - 2, // 11: livekit.RoomService.ListRooms:output_type -> livekit.ListRoomsResponse - 4, // 12: livekit.RoomService.DeleteRoom:output_type -> livekit.DeleteRoomResponse - 6, // 13: livekit.RoomService.ListParticipants:output_type -> livekit.ListParticipantsResponse - 12, // 14: livekit.RoomService.GetParticipant:output_type -> livekit.ParticipantInfo - 8, // 15: livekit.RoomService.RemoveParticipant:output_type -> livekit.RemoveParticipantResponse - 10, // 16: livekit.RoomService.MutePublishedTrack:output_type -> livekit.MuteRoomTrackResponse - 10, // [10:17] is the sub-list for method output_type - 3, // [3:10] 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_room_proto_init() } -func file_room_proto_init() { - if File_room_proto != nil { - return - } - file_model_proto_init() - if !protoimpl.UnsafeEnabled { - file_room_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateRoomRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_room_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRoomsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_room_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRoomsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_room_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRoomRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_room_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRoomResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_room_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListParticipantsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_room_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListParticipantsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_room_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RoomParticipantIdentity); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_room_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveParticipantResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_room_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MuteRoomTrackRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_room_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MuteRoomTrackResponse); 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_room_proto_rawDesc, - NumEnums: 0, - NumMessages: 11, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_room_proto_goTypes, - DependencyIndexes: file_room_proto_depIdxs, - MessageInfos: file_room_proto_msgTypes, - }.Build() - File_room_proto = out.File - file_room_proto_rawDesc = nil - file_room_proto_goTypes = nil - file_room_proto_depIdxs = nil -} diff --git a/proto/livekit/room.twirp.go b/proto/livekit/room.twirp.go deleted file mode 100644 index db78a4fc7..000000000 --- a/proto/livekit/room.twirp.go +++ /dev/null @@ -1,2732 +0,0 @@ -// Code generated by protoc-gen-twirp v7.1.0, DO NOT EDIT. -// source: room.proto - -/* -Package livekit is a generated twirp stub package. -This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v7.1.0. - -It is generated from these files: - room.proto -*/ -package livekit - -import bytes "bytes" -import strings "strings" -import context "context" -import fmt "fmt" -import ioutil "io/ioutil" -import http "net/http" -import strconv "strconv" - -import jsonpb "github.com/golang/protobuf/jsonpb" -import proto "github.com/golang/protobuf/proto" -import twirp "github.com/twitchtv/twirp" -import ctxsetters "github.com/twitchtv/twirp/ctxsetters" - -// Imports only used by utility functions: -import io "io" -import json "encoding/json" -import path "path" -import url "net/url" - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the twirp package used in your project. -// A compilation error at this line likely means your copy of the -// twirp package needs to be updated. -const _ = twirp.TwirpPackageIsVersion7 - -// ===================== -// RoomService Interface -// ===================== - -// Room service that can be performed on any node -// they are Twirp-based HTTP req/responses -type RoomService interface { - // should be accessible to only internal servers, not external - CreateRoom(context.Context, *CreateRoomRequest) (*Room, error) - - ListRooms(context.Context, *ListRoomsRequest) (*ListRoomsResponse, error) - - DeleteRoom(context.Context, *DeleteRoomRequest) (*DeleteRoomResponse, error) - - // lists participants in a room, requires RoomAdmin - ListParticipants(context.Context, *ListParticipantsRequest) (*ListParticipantsResponse, error) - - // get information on a specific participant, requires RoomAdmin - GetParticipant(context.Context, *RoomParticipantIdentity) (*ParticipantInfo, error) - - // removes a participant from room, requires RoomAdmin - RemoveParticipant(context.Context, *RoomParticipantIdentity) (*RemoveParticipantResponse, error) - - // mute/unmute a participant, requires RoomAdmin - MutePublishedTrack(context.Context, *MuteRoomTrackRequest) (*MuteRoomTrackResponse, error) -} - -// =========================== -// RoomService Protobuf Client -// =========================== - -type roomServiceProtobufClient struct { - client HTTPClient - urls [7]string - interceptor twirp.Interceptor - opts twirp.ClientOptions -} - -// NewRoomServiceProtobufClient creates a Protobuf client that implements the RoomService interface. -// It communicates using Protobuf and can be configured with a custom HTTPClient. -func NewRoomServiceProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) RoomService { - if c, ok := client.(*http.Client); ok { - client = withoutRedirects(c) - } - - clientOpts := twirp.ClientOptions{} - for _, o := range opts { - o(&clientOpts) - } - - // Build method URLs: []/./ - serviceURL := sanitizeBaseURL(baseURL) - serviceURL += baseServicePath(clientOpts.PathPrefix(), "livekit", "RoomService") - urls := [7]string{ - serviceURL + "CreateRoom", - serviceURL + "ListRooms", - serviceURL + "DeleteRoom", - serviceURL + "ListParticipants", - serviceURL + "GetParticipant", - serviceURL + "RemoveParticipant", - serviceURL + "MutePublishedTrack", - } - - return &roomServiceProtobufClient{ - client: client, - urls: urls, - interceptor: twirp.ChainInterceptors(clientOpts.Interceptors...), - opts: clientOpts, - } -} - -func (c *roomServiceProtobufClient) CreateRoom(ctx context.Context, in *CreateRoomRequest) (*Room, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "RoomService") - ctx = ctxsetters.WithMethodName(ctx, "CreateRoom") - caller := c.callCreateRoom - if c.interceptor != nil { - caller = func(ctx context.Context, req *CreateRoomRequest) (*Room, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*CreateRoomRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*CreateRoomRequest) when calling interceptor") - } - return c.callCreateRoom(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*Room) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*Room) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *roomServiceProtobufClient) callCreateRoom(ctx context.Context, in *CreateRoomRequest) (*Room, error) { - out := new(Room) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *roomServiceProtobufClient) ListRooms(ctx context.Context, in *ListRoomsRequest) (*ListRoomsResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "RoomService") - ctx = ctxsetters.WithMethodName(ctx, "ListRooms") - caller := c.callListRooms - if c.interceptor != nil { - caller = func(ctx context.Context, req *ListRoomsRequest) (*ListRoomsResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListRoomsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListRoomsRequest) when calling interceptor") - } - return c.callListRooms(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListRoomsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListRoomsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *roomServiceProtobufClient) callListRooms(ctx context.Context, in *ListRoomsRequest) (*ListRoomsResponse, error) { - out := new(ListRoomsResponse) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[1], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *roomServiceProtobufClient) DeleteRoom(ctx context.Context, in *DeleteRoomRequest) (*DeleteRoomResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "RoomService") - ctx = ctxsetters.WithMethodName(ctx, "DeleteRoom") - caller := c.callDeleteRoom - if c.interceptor != nil { - caller = func(ctx context.Context, req *DeleteRoomRequest) (*DeleteRoomResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*DeleteRoomRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*DeleteRoomRequest) when calling interceptor") - } - return c.callDeleteRoom(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*DeleteRoomResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*DeleteRoomResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *roomServiceProtobufClient) callDeleteRoom(ctx context.Context, in *DeleteRoomRequest) (*DeleteRoomResponse, error) { - out := new(DeleteRoomResponse) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[2], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *roomServiceProtobufClient) ListParticipants(ctx context.Context, in *ListParticipantsRequest) (*ListParticipantsResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "RoomService") - ctx = ctxsetters.WithMethodName(ctx, "ListParticipants") - caller := c.callListParticipants - if c.interceptor != nil { - caller = func(ctx context.Context, req *ListParticipantsRequest) (*ListParticipantsResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListParticipantsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListParticipantsRequest) when calling interceptor") - } - return c.callListParticipants(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListParticipantsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListParticipantsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *roomServiceProtobufClient) callListParticipants(ctx context.Context, in *ListParticipantsRequest) (*ListParticipantsResponse, error) { - out := new(ListParticipantsResponse) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[3], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *roomServiceProtobufClient) GetParticipant(ctx context.Context, in *RoomParticipantIdentity) (*ParticipantInfo, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "RoomService") - ctx = ctxsetters.WithMethodName(ctx, "GetParticipant") - caller := c.callGetParticipant - if c.interceptor != nil { - caller = func(ctx context.Context, req *RoomParticipantIdentity) (*ParticipantInfo, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*RoomParticipantIdentity) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*RoomParticipantIdentity) when calling interceptor") - } - return c.callGetParticipant(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ParticipantInfo) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ParticipantInfo) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *roomServiceProtobufClient) callGetParticipant(ctx context.Context, in *RoomParticipantIdentity) (*ParticipantInfo, error) { - out := new(ParticipantInfo) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[4], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *roomServiceProtobufClient) RemoveParticipant(ctx context.Context, in *RoomParticipantIdentity) (*RemoveParticipantResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "RoomService") - ctx = ctxsetters.WithMethodName(ctx, "RemoveParticipant") - caller := c.callRemoveParticipant - if c.interceptor != nil { - caller = func(ctx context.Context, req *RoomParticipantIdentity) (*RemoveParticipantResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*RoomParticipantIdentity) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*RoomParticipantIdentity) when calling interceptor") - } - return c.callRemoveParticipant(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*RemoveParticipantResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*RemoveParticipantResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *roomServiceProtobufClient) callRemoveParticipant(ctx context.Context, in *RoomParticipantIdentity) (*RemoveParticipantResponse, error) { - out := new(RemoveParticipantResponse) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[5], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *roomServiceProtobufClient) MutePublishedTrack(ctx context.Context, in *MuteRoomTrackRequest) (*MuteRoomTrackResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "RoomService") - ctx = ctxsetters.WithMethodName(ctx, "MutePublishedTrack") - caller := c.callMutePublishedTrack - if c.interceptor != nil { - caller = func(ctx context.Context, req *MuteRoomTrackRequest) (*MuteRoomTrackResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*MuteRoomTrackRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*MuteRoomTrackRequest) when calling interceptor") - } - return c.callMutePublishedTrack(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*MuteRoomTrackResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*MuteRoomTrackResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *roomServiceProtobufClient) callMutePublishedTrack(ctx context.Context, in *MuteRoomTrackRequest) (*MuteRoomTrackResponse, error) { - out := new(MuteRoomTrackResponse) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[6], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -// ======================= -// RoomService JSON Client -// ======================= - -type roomServiceJSONClient struct { - client HTTPClient - urls [7]string - interceptor twirp.Interceptor - opts twirp.ClientOptions -} - -// NewRoomServiceJSONClient creates a JSON client that implements the RoomService interface. -// It communicates using JSON and can be configured with a custom HTTPClient. -func NewRoomServiceJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) RoomService { - if c, ok := client.(*http.Client); ok { - client = withoutRedirects(c) - } - - clientOpts := twirp.ClientOptions{} - for _, o := range opts { - o(&clientOpts) - } - - // Build method URLs: []/./ - serviceURL := sanitizeBaseURL(baseURL) - serviceURL += baseServicePath(clientOpts.PathPrefix(), "livekit", "RoomService") - urls := [7]string{ - serviceURL + "CreateRoom", - serviceURL + "ListRooms", - serviceURL + "DeleteRoom", - serviceURL + "ListParticipants", - serviceURL + "GetParticipant", - serviceURL + "RemoveParticipant", - serviceURL + "MutePublishedTrack", - } - - return &roomServiceJSONClient{ - client: client, - urls: urls, - interceptor: twirp.ChainInterceptors(clientOpts.Interceptors...), - opts: clientOpts, - } -} - -func (c *roomServiceJSONClient) CreateRoom(ctx context.Context, in *CreateRoomRequest) (*Room, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "RoomService") - ctx = ctxsetters.WithMethodName(ctx, "CreateRoom") - caller := c.callCreateRoom - if c.interceptor != nil { - caller = func(ctx context.Context, req *CreateRoomRequest) (*Room, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*CreateRoomRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*CreateRoomRequest) when calling interceptor") - } - return c.callCreateRoom(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*Room) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*Room) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *roomServiceJSONClient) callCreateRoom(ctx context.Context, in *CreateRoomRequest) (*Room, error) { - out := new(Room) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *roomServiceJSONClient) ListRooms(ctx context.Context, in *ListRoomsRequest) (*ListRoomsResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "RoomService") - ctx = ctxsetters.WithMethodName(ctx, "ListRooms") - caller := c.callListRooms - if c.interceptor != nil { - caller = func(ctx context.Context, req *ListRoomsRequest) (*ListRoomsResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListRoomsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListRoomsRequest) when calling interceptor") - } - return c.callListRooms(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListRoomsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListRoomsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *roomServiceJSONClient) callListRooms(ctx context.Context, in *ListRoomsRequest) (*ListRoomsResponse, error) { - out := new(ListRoomsResponse) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[1], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *roomServiceJSONClient) DeleteRoom(ctx context.Context, in *DeleteRoomRequest) (*DeleteRoomResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "RoomService") - ctx = ctxsetters.WithMethodName(ctx, "DeleteRoom") - caller := c.callDeleteRoom - if c.interceptor != nil { - caller = func(ctx context.Context, req *DeleteRoomRequest) (*DeleteRoomResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*DeleteRoomRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*DeleteRoomRequest) when calling interceptor") - } - return c.callDeleteRoom(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*DeleteRoomResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*DeleteRoomResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *roomServiceJSONClient) callDeleteRoom(ctx context.Context, in *DeleteRoomRequest) (*DeleteRoomResponse, error) { - out := new(DeleteRoomResponse) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[2], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *roomServiceJSONClient) ListParticipants(ctx context.Context, in *ListParticipantsRequest) (*ListParticipantsResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "RoomService") - ctx = ctxsetters.WithMethodName(ctx, "ListParticipants") - caller := c.callListParticipants - if c.interceptor != nil { - caller = func(ctx context.Context, req *ListParticipantsRequest) (*ListParticipantsResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListParticipantsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListParticipantsRequest) when calling interceptor") - } - return c.callListParticipants(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListParticipantsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListParticipantsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *roomServiceJSONClient) callListParticipants(ctx context.Context, in *ListParticipantsRequest) (*ListParticipantsResponse, error) { - out := new(ListParticipantsResponse) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[3], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *roomServiceJSONClient) GetParticipant(ctx context.Context, in *RoomParticipantIdentity) (*ParticipantInfo, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "RoomService") - ctx = ctxsetters.WithMethodName(ctx, "GetParticipant") - caller := c.callGetParticipant - if c.interceptor != nil { - caller = func(ctx context.Context, req *RoomParticipantIdentity) (*ParticipantInfo, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*RoomParticipantIdentity) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*RoomParticipantIdentity) when calling interceptor") - } - return c.callGetParticipant(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ParticipantInfo) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ParticipantInfo) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *roomServiceJSONClient) callGetParticipant(ctx context.Context, in *RoomParticipantIdentity) (*ParticipantInfo, error) { - out := new(ParticipantInfo) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[4], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *roomServiceJSONClient) RemoveParticipant(ctx context.Context, in *RoomParticipantIdentity) (*RemoveParticipantResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "RoomService") - ctx = ctxsetters.WithMethodName(ctx, "RemoveParticipant") - caller := c.callRemoveParticipant - if c.interceptor != nil { - caller = func(ctx context.Context, req *RoomParticipantIdentity) (*RemoveParticipantResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*RoomParticipantIdentity) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*RoomParticipantIdentity) when calling interceptor") - } - return c.callRemoveParticipant(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*RemoveParticipantResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*RemoveParticipantResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *roomServiceJSONClient) callRemoveParticipant(ctx context.Context, in *RoomParticipantIdentity) (*RemoveParticipantResponse, error) { - out := new(RemoveParticipantResponse) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[5], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *roomServiceJSONClient) MutePublishedTrack(ctx context.Context, in *MuteRoomTrackRequest) (*MuteRoomTrackResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "RoomService") - ctx = ctxsetters.WithMethodName(ctx, "MutePublishedTrack") - caller := c.callMutePublishedTrack - if c.interceptor != nil { - caller = func(ctx context.Context, req *MuteRoomTrackRequest) (*MuteRoomTrackResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*MuteRoomTrackRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*MuteRoomTrackRequest) when calling interceptor") - } - return c.callMutePublishedTrack(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*MuteRoomTrackResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*MuteRoomTrackResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *roomServiceJSONClient) callMutePublishedTrack(ctx context.Context, in *MuteRoomTrackRequest) (*MuteRoomTrackResponse, error) { - out := new(MuteRoomTrackResponse) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[6], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -// ========================== -// RoomService Server Handler -// ========================== - -type roomServiceServer struct { - RoomService - interceptor twirp.Interceptor - hooks *twirp.ServerHooks - pathPrefix string // prefix for routing - jsonSkipDefaults bool // do not include unpopulated fields (default values) in the response -} - -// NewRoomServiceServer builds a TwirpServer that can be used as an http.Handler to handle -// HTTP requests that are routed to the right method in the provided svc implementation. -// The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks). -func NewRoomServiceServer(svc RoomService, opts ...interface{}) TwirpServer { - serverOpts := twirp.ServerOptions{} - for _, opt := range opts { - switch o := opt.(type) { - case twirp.ServerOption: - o(&serverOpts) - case *twirp.ServerHooks: // backwards compatibility, allow to specify hooks as an argument - twirp.WithServerHooks(o)(&serverOpts) - case nil: // backwards compatibility, allow nil value for the argument - continue - default: - panic(fmt.Sprintf("Invalid option type %T on NewRoomServiceServer", o)) - } - } - - return &roomServiceServer{ - RoomService: svc, - pathPrefix: serverOpts.PathPrefix(), - interceptor: twirp.ChainInterceptors(serverOpts.Interceptors...), - hooks: serverOpts.Hooks, - jsonSkipDefaults: serverOpts.JSONSkipDefaults, - } -} - -// writeError writes an HTTP response with a valid Twirp error format, and triggers hooks. -// If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err) -func (s *roomServiceServer) writeError(ctx context.Context, resp http.ResponseWriter, err error) { - writeError(ctx, resp, err, s.hooks) -} - -// RoomServicePathPrefix is a convenience constant that could used to identify URL paths. -// Should be used with caution, it only matches routes generated by Twirp Go clients, -// that add a "/twirp" prefix by default, and use CamelCase service and method names. -// More info: https://twitchtv.github.io/twirp/docs/routing.html -const RoomServicePathPrefix = "/twirp/livekit.RoomService/" - -func (s *roomServiceServer) ServeHTTP(resp http.ResponseWriter, req *http.Request) { - ctx := req.Context() - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "RoomService") - ctx = ctxsetters.WithResponseWriter(ctx, resp) - - var err error - ctx, err = callRequestReceived(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - if req.Method != "POST" { - msg := fmt.Sprintf("unsupported method %q (only POST is allowed)", req.Method) - s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path)) - return - } - - // Verify path format: []/./ - prefix, pkgService, method := parseTwirpPath(req.URL.Path) - if pkgService != "livekit.RoomService" { - msg := fmt.Sprintf("no handler for path %q", req.URL.Path) - s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path)) - return - } - if prefix != s.pathPrefix { - msg := fmt.Sprintf("invalid path prefix %q, expected %q, on path %q", prefix, s.pathPrefix, req.URL.Path) - s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path)) - return - } - - switch method { - case "CreateRoom": - s.serveCreateRoom(ctx, resp, req) - return - case "ListRooms": - s.serveListRooms(ctx, resp, req) - return - case "DeleteRoom": - s.serveDeleteRoom(ctx, resp, req) - return - case "ListParticipants": - s.serveListParticipants(ctx, resp, req) - return - case "GetParticipant": - s.serveGetParticipant(ctx, resp, req) - return - case "RemoveParticipant": - s.serveRemoveParticipant(ctx, resp, req) - return - case "MutePublishedTrack": - s.serveMutePublishedTrack(ctx, resp, req) - return - default: - msg := fmt.Sprintf("no handler for path %q", req.URL.Path) - s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path)) - return - } -} - -func (s *roomServiceServer) serveCreateRoom(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveCreateRoomJSON(ctx, resp, req) - case "application/protobuf": - s.serveCreateRoomProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *roomServiceServer) serveCreateRoomJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "CreateRoom") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - reqContent := new(CreateRoomRequest) - unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true} - if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded")) - return - } - - handler := s.RoomService.CreateRoom - if s.interceptor != nil { - handler = func(ctx context.Context, req *CreateRoomRequest) (*Room, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*CreateRoomRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*CreateRoomRequest) when calling interceptor") - } - return s.RoomService.CreateRoom(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*Room) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*Room) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *Room - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *Room and nil error while calling CreateRoom. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - var buf bytes.Buffer - marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults} - if err = marshaler.Marshal(&buf, respContent); err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - respBytes := buf.Bytes() - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *roomServiceServer) serveCreateRoomProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "CreateRoom") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := ioutil.ReadAll(req.Body) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to read request body")) - return - } - reqContent := new(CreateRoomRequest) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.RoomService.CreateRoom - if s.interceptor != nil { - handler = func(ctx context.Context, req *CreateRoomRequest) (*Room, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*CreateRoomRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*CreateRoomRequest) when calling interceptor") - } - return s.RoomService.CreateRoom(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*Room) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*Room) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *Room - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *Room and nil error while calling CreateRoom. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *roomServiceServer) serveListRooms(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveListRoomsJSON(ctx, resp, req) - case "application/protobuf": - s.serveListRoomsProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *roomServiceServer) serveListRoomsJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "ListRooms") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - reqContent := new(ListRoomsRequest) - unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true} - if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded")) - return - } - - handler := s.RoomService.ListRooms - if s.interceptor != nil { - handler = func(ctx context.Context, req *ListRoomsRequest) (*ListRoomsResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListRoomsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListRoomsRequest) when calling interceptor") - } - return s.RoomService.ListRooms(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListRoomsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListRoomsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *ListRoomsResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *ListRoomsResponse and nil error while calling ListRooms. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - var buf bytes.Buffer - marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults} - if err = marshaler.Marshal(&buf, respContent); err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - respBytes := buf.Bytes() - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *roomServiceServer) serveListRoomsProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "ListRooms") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := ioutil.ReadAll(req.Body) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to read request body")) - return - } - reqContent := new(ListRoomsRequest) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.RoomService.ListRooms - if s.interceptor != nil { - handler = func(ctx context.Context, req *ListRoomsRequest) (*ListRoomsResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListRoomsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListRoomsRequest) when calling interceptor") - } - return s.RoomService.ListRooms(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListRoomsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListRoomsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *ListRoomsResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *ListRoomsResponse and nil error while calling ListRooms. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *roomServiceServer) serveDeleteRoom(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveDeleteRoomJSON(ctx, resp, req) - case "application/protobuf": - s.serveDeleteRoomProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *roomServiceServer) serveDeleteRoomJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "DeleteRoom") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - reqContent := new(DeleteRoomRequest) - unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true} - if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded")) - return - } - - handler := s.RoomService.DeleteRoom - if s.interceptor != nil { - handler = func(ctx context.Context, req *DeleteRoomRequest) (*DeleteRoomResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*DeleteRoomRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*DeleteRoomRequest) when calling interceptor") - } - return s.RoomService.DeleteRoom(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*DeleteRoomResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*DeleteRoomResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *DeleteRoomResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *DeleteRoomResponse and nil error while calling DeleteRoom. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - var buf bytes.Buffer - marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults} - if err = marshaler.Marshal(&buf, respContent); err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - respBytes := buf.Bytes() - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *roomServiceServer) serveDeleteRoomProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "DeleteRoom") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := ioutil.ReadAll(req.Body) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to read request body")) - return - } - reqContent := new(DeleteRoomRequest) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.RoomService.DeleteRoom - if s.interceptor != nil { - handler = func(ctx context.Context, req *DeleteRoomRequest) (*DeleteRoomResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*DeleteRoomRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*DeleteRoomRequest) when calling interceptor") - } - return s.RoomService.DeleteRoom(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*DeleteRoomResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*DeleteRoomResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *DeleteRoomResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *DeleteRoomResponse and nil error while calling DeleteRoom. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *roomServiceServer) serveListParticipants(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveListParticipantsJSON(ctx, resp, req) - case "application/protobuf": - s.serveListParticipantsProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *roomServiceServer) serveListParticipantsJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "ListParticipants") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - reqContent := new(ListParticipantsRequest) - unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true} - if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded")) - return - } - - handler := s.RoomService.ListParticipants - if s.interceptor != nil { - handler = func(ctx context.Context, req *ListParticipantsRequest) (*ListParticipantsResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListParticipantsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListParticipantsRequest) when calling interceptor") - } - return s.RoomService.ListParticipants(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListParticipantsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListParticipantsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *ListParticipantsResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *ListParticipantsResponse and nil error while calling ListParticipants. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - var buf bytes.Buffer - marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults} - if err = marshaler.Marshal(&buf, respContent); err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - respBytes := buf.Bytes() - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *roomServiceServer) serveListParticipantsProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "ListParticipants") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := ioutil.ReadAll(req.Body) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to read request body")) - return - } - reqContent := new(ListParticipantsRequest) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.RoomService.ListParticipants - if s.interceptor != nil { - handler = func(ctx context.Context, req *ListParticipantsRequest) (*ListParticipantsResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListParticipantsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListParticipantsRequest) when calling interceptor") - } - return s.RoomService.ListParticipants(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListParticipantsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListParticipantsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *ListParticipantsResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *ListParticipantsResponse and nil error while calling ListParticipants. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *roomServiceServer) serveGetParticipant(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveGetParticipantJSON(ctx, resp, req) - case "application/protobuf": - s.serveGetParticipantProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *roomServiceServer) serveGetParticipantJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "GetParticipant") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - reqContent := new(RoomParticipantIdentity) - unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true} - if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded")) - return - } - - handler := s.RoomService.GetParticipant - if s.interceptor != nil { - handler = func(ctx context.Context, req *RoomParticipantIdentity) (*ParticipantInfo, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*RoomParticipantIdentity) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*RoomParticipantIdentity) when calling interceptor") - } - return s.RoomService.GetParticipant(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ParticipantInfo) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ParticipantInfo) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *ParticipantInfo - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *ParticipantInfo and nil error while calling GetParticipant. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - var buf bytes.Buffer - marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults} - if err = marshaler.Marshal(&buf, respContent); err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - respBytes := buf.Bytes() - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *roomServiceServer) serveGetParticipantProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "GetParticipant") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := ioutil.ReadAll(req.Body) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to read request body")) - return - } - reqContent := new(RoomParticipantIdentity) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.RoomService.GetParticipant - if s.interceptor != nil { - handler = func(ctx context.Context, req *RoomParticipantIdentity) (*ParticipantInfo, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*RoomParticipantIdentity) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*RoomParticipantIdentity) when calling interceptor") - } - return s.RoomService.GetParticipant(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ParticipantInfo) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ParticipantInfo) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *ParticipantInfo - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *ParticipantInfo and nil error while calling GetParticipant. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *roomServiceServer) serveRemoveParticipant(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveRemoveParticipantJSON(ctx, resp, req) - case "application/protobuf": - s.serveRemoveParticipantProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *roomServiceServer) serveRemoveParticipantJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "RemoveParticipant") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - reqContent := new(RoomParticipantIdentity) - unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true} - if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded")) - return - } - - handler := s.RoomService.RemoveParticipant - if s.interceptor != nil { - handler = func(ctx context.Context, req *RoomParticipantIdentity) (*RemoveParticipantResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*RoomParticipantIdentity) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*RoomParticipantIdentity) when calling interceptor") - } - return s.RoomService.RemoveParticipant(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*RemoveParticipantResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*RemoveParticipantResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *RemoveParticipantResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *RemoveParticipantResponse and nil error while calling RemoveParticipant. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - var buf bytes.Buffer - marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults} - if err = marshaler.Marshal(&buf, respContent); err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - respBytes := buf.Bytes() - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *roomServiceServer) serveRemoveParticipantProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "RemoveParticipant") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := ioutil.ReadAll(req.Body) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to read request body")) - return - } - reqContent := new(RoomParticipantIdentity) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.RoomService.RemoveParticipant - if s.interceptor != nil { - handler = func(ctx context.Context, req *RoomParticipantIdentity) (*RemoveParticipantResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*RoomParticipantIdentity) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*RoomParticipantIdentity) when calling interceptor") - } - return s.RoomService.RemoveParticipant(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*RemoveParticipantResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*RemoveParticipantResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *RemoveParticipantResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *RemoveParticipantResponse and nil error while calling RemoveParticipant. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *roomServiceServer) serveMutePublishedTrack(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveMutePublishedTrackJSON(ctx, resp, req) - case "application/protobuf": - s.serveMutePublishedTrackProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *roomServiceServer) serveMutePublishedTrackJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "MutePublishedTrack") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - reqContent := new(MuteRoomTrackRequest) - unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true} - if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded")) - return - } - - handler := s.RoomService.MutePublishedTrack - if s.interceptor != nil { - handler = func(ctx context.Context, req *MuteRoomTrackRequest) (*MuteRoomTrackResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*MuteRoomTrackRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*MuteRoomTrackRequest) when calling interceptor") - } - return s.RoomService.MutePublishedTrack(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*MuteRoomTrackResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*MuteRoomTrackResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *MuteRoomTrackResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *MuteRoomTrackResponse and nil error while calling MutePublishedTrack. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - var buf bytes.Buffer - marshaler := &jsonpb.Marshaler{OrigName: true, EmitDefaults: !s.jsonSkipDefaults} - if err = marshaler.Marshal(&buf, respContent); err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - respBytes := buf.Bytes() - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *roomServiceServer) serveMutePublishedTrackProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "MutePublishedTrack") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := ioutil.ReadAll(req.Body) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to read request body")) - return - } - reqContent := new(MuteRoomTrackRequest) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.RoomService.MutePublishedTrack - if s.interceptor != nil { - handler = func(ctx context.Context, req *MuteRoomTrackRequest) (*MuteRoomTrackResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*MuteRoomTrackRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*MuteRoomTrackRequest) when calling interceptor") - } - return s.RoomService.MutePublishedTrack(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*MuteRoomTrackResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*MuteRoomTrackResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *MuteRoomTrackResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *MuteRoomTrackResponse and nil error while calling MutePublishedTrack. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *roomServiceServer) ServiceDescriptor() ([]byte, int) { - return twirpFileDescriptor0, 0 -} - -func (s *roomServiceServer) ProtocGenTwirpVersion() string { - return "v7.1.0" -} - -// PathPrefix returns the base service path, in the form: "//./" -// that is everything in a Twirp route except for the . This can be used for routing, -// for example to identify the requests that are targeted to this service in a mux. -func (s *roomServiceServer) PathPrefix() string { - return baseServicePath(s.pathPrefix, "livekit", "RoomService") -} - -// ===== -// Utils -// ===== - -// HTTPClient is the interface used by generated clients to send HTTP requests. -// It is fulfilled by *(net/http).Client, which is sufficient for most users. -// Users can provide their own implementation for special retry policies. -// -// HTTPClient implementations should not follow redirects. Redirects are -// automatically disabled if *(net/http).Client is passed to client -// constructors. See the withoutRedirects function in this file for more -// details. -type HTTPClient interface { - Do(req *http.Request) (*http.Response, error) -} - -// TwirpServer is the interface generated server structs will support: they're -// HTTP handlers with additional methods for accessing metadata about the -// service. Those accessors are a low-level API for building reflection tools. -// Most people can think of TwirpServers as just http.Handlers. -type TwirpServer interface { - http.Handler - - // ServiceDescriptor returns gzipped bytes describing the .proto file that - // this service was generated from. Once unzipped, the bytes can be - // unmarshalled as a - // github.com/golang/protobuf/protoc-gen-go/descriptor.FileDescriptorProto. - // - // The returned integer is the index of this particular service within that - // FileDescriptorProto's 'Service' slice of ServiceDescriptorProtos. This is a - // low-level field, expected to be used for reflection. - ServiceDescriptor() ([]byte, int) - - // ProtocGenTwirpVersion is the semantic version string of the version of - // twirp used to generate this file. - ProtocGenTwirpVersion() string - - // PathPrefix returns the HTTP URL path prefix for all methods handled by this - // service. This can be used with an HTTP mux to route Twirp requests. - // The path prefix is in the form: "//./" - // that is, everything in a Twirp route except for the at the end. - PathPrefix() string -} - -// WriteError writes an HTTP response with a valid Twirp error format (code, msg, meta). -// Useful outside of the Twirp server (e.g. http middleware), but does not trigger hooks. -// If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err) -func WriteError(resp http.ResponseWriter, err error) { - writeError(context.Background(), resp, err, nil) -} - -// writeError writes Twirp errors in the response and triggers hooks. -func writeError(ctx context.Context, resp http.ResponseWriter, err error, hooks *twirp.ServerHooks) { - // Non-twirp errors are wrapped as Internal (default) - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - - statusCode := twirp.ServerHTTPStatusFromErrorCode(twerr.Code()) - ctx = ctxsetters.WithStatusCode(ctx, statusCode) - ctx = callError(ctx, hooks, twerr) - - respBody := marshalErrorToJSON(twerr) - - resp.Header().Set("Content-Type", "application/json") // Error responses are always JSON - resp.Header().Set("Content-Length", strconv.Itoa(len(respBody))) - resp.WriteHeader(statusCode) // set HTTP status code and send response - - _, writeErr := resp.Write(respBody) - if writeErr != nil { - // We have three options here. We could log the error, call the Error - // hook, or just silently ignore the error. - // - // Logging is unacceptable because we don't have a user-controlled - // logger; writing out to stderr without permission is too rude. - // - // Calling the Error hook would confuse users: it would mean the Error - // hook got called twice for one request, which is likely to lead to - // duplicated log messages and metrics, no matter how well we document - // the behavior. - // - // Silently ignoring the error is our least-bad option. It's highly - // likely that the connection is broken and the original 'err' says - // so anyway. - _ = writeErr - } - - callResponseSent(ctx, hooks) -} - -// sanitizeBaseURL parses the the baseURL, and adds the "http" scheme if needed. -// If the URL is unparsable, the baseURL is returned unchaged. -func sanitizeBaseURL(baseURL string) string { - u, err := url.Parse(baseURL) - if err != nil { - return baseURL // invalid URL will fail later when making requests - } - if u.Scheme == "" { - u.Scheme = "http" - } - return u.String() -} - -// baseServicePath composes the path prefix for the service (without ). -// e.g.: baseServicePath("/twirp", "my.pkg", "MyService") -// returns => "/twirp/my.pkg.MyService/" -// e.g.: baseServicePath("", "", "MyService") -// returns => "/MyService/" -func baseServicePath(prefix, pkg, service string) string { - fullServiceName := service - if pkg != "" { - fullServiceName = pkg + "." + service - } - return path.Join("/", prefix, fullServiceName) + "/" -} - -// parseTwirpPath extracts path components form a valid Twirp route. -// Expected format: "[]/./" -// e.g.: prefix, pkgService, method := parseTwirpPath("/twirp/pkg.Svc/MakeHat") -func parseTwirpPath(path string) (string, string, string) { - parts := strings.Split(path, "/") - if len(parts) < 2 { - return "", "", "" - } - method := parts[len(parts)-1] - pkgService := parts[len(parts)-2] - prefix := strings.Join(parts[0:len(parts)-2], "/") - return prefix, pkgService, method -} - -// getCustomHTTPReqHeaders retrieves a copy of any headers that are set in -// a context through the twirp.WithHTTPRequestHeaders function. -// If there are no headers set, or if they have the wrong type, nil is returned. -func getCustomHTTPReqHeaders(ctx context.Context) http.Header { - header, ok := twirp.HTTPRequestHeaders(ctx) - if !ok || header == nil { - return nil - } - copied := make(http.Header) - for k, vv := range header { - if vv == nil { - copied[k] = nil - continue - } - copied[k] = make([]string, len(vv)) - copy(copied[k], vv) - } - return copied -} - -// newRequest makes an http.Request from a client, adding common headers. -func newRequest(ctx context.Context, url string, reqBody io.Reader, contentType string) (*http.Request, error) { - req, err := http.NewRequest("POST", url, reqBody) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if customHeader := getCustomHTTPReqHeaders(ctx); customHeader != nil { - req.Header = customHeader - } - req.Header.Set("Accept", contentType) - req.Header.Set("Content-Type", contentType) - req.Header.Set("Twirp-Version", "v7.1.0") - return req, nil -} - -// JSON serialization for errors -type twerrJSON struct { - Code string `json:"code"` - Msg string `json:"msg"` - Meta map[string]string `json:"meta,omitempty"` -} - -// marshalErrorToJSON returns JSON from a twirp.Error, that can be used as HTTP error response body. -// If serialization fails, it will use a descriptive Internal error instead. -func marshalErrorToJSON(twerr twirp.Error) []byte { - // make sure that msg is not too large - msg := twerr.Msg() - if len(msg) > 1e6 { - msg = msg[:1e6] - } - - tj := twerrJSON{ - Code: string(twerr.Code()), - Msg: msg, - Meta: twerr.MetaMap(), - } - - buf, err := json.Marshal(&tj) - if err != nil { - buf = []byte("{\"type\": \"" + twirp.Internal + "\", \"msg\": \"There was an error but it could not be serialized into JSON\"}") // fallback - } - - return buf -} - -// errorFromResponse builds a twirp.Error from a non-200 HTTP response. -// If the response has a valid serialized Twirp error, then it's returned. -// If not, the response status code is used to generate a similar twirp -// error. See twirpErrorFromIntermediary for more info on intermediary errors. -func errorFromResponse(resp *http.Response) twirp.Error { - statusCode := resp.StatusCode - statusText := http.StatusText(statusCode) - - if isHTTPRedirect(statusCode) { - // Unexpected redirect: it must be an error from an intermediary. - // Twirp clients don't follow redirects automatically, Twirp only handles - // POST requests, redirects should only happen on GET and HEAD requests. - location := resp.Header.Get("Location") - msg := fmt.Sprintf("unexpected HTTP status code %d %q received, Location=%q", statusCode, statusText, location) - return twirpErrorFromIntermediary(statusCode, msg, location) - } - - respBodyBytes, err := ioutil.ReadAll(resp.Body) - if err != nil { - return wrapInternal(err, "failed to read server error response body") - } - - var tj twerrJSON - dec := json.NewDecoder(bytes.NewReader(respBodyBytes)) - dec.DisallowUnknownFields() - if err := dec.Decode(&tj); err != nil || tj.Code == "" { - // Invalid JSON response; it must be an error from an intermediary. - msg := fmt.Sprintf("Error from intermediary with HTTP status code %d %q", statusCode, statusText) - return twirpErrorFromIntermediary(statusCode, msg, string(respBodyBytes)) - } - - errorCode := twirp.ErrorCode(tj.Code) - if !twirp.IsValidErrorCode(errorCode) { - msg := "invalid type returned from server error response: " + tj.Code - return twirp.InternalError(msg).WithMeta("body", string(respBodyBytes)) - } - - twerr := twirp.NewError(errorCode, tj.Msg) - for k, v := range tj.Meta { - twerr = twerr.WithMeta(k, v) - } - return twerr -} - -// twirpErrorFromIntermediary maps HTTP errors from non-twirp sources to twirp errors. -// The mapping is similar to gRPC: https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md. -// Returned twirp Errors have some additional metadata for inspection. -func twirpErrorFromIntermediary(status int, msg string, bodyOrLocation string) twirp.Error { - var code twirp.ErrorCode - if isHTTPRedirect(status) { // 3xx - code = twirp.Internal - } else { - switch status { - case 400: // Bad Request - code = twirp.Internal - case 401: // Unauthorized - code = twirp.Unauthenticated - case 403: // Forbidden - code = twirp.PermissionDenied - case 404: // Not Found - code = twirp.BadRoute - case 429: // Too Many Requests - code = twirp.ResourceExhausted - case 502, 503, 504: // Bad Gateway, Service Unavailable, Gateway Timeout - code = twirp.Unavailable - default: // All other codes - code = twirp.Unknown - } - } - - twerr := twirp.NewError(code, msg) - twerr = twerr.WithMeta("http_error_from_intermediary", "true") // to easily know if this error was from intermediary - twerr = twerr.WithMeta("status_code", strconv.Itoa(status)) - if isHTTPRedirect(status) { - twerr = twerr.WithMeta("location", bodyOrLocation) - } else { - twerr = twerr.WithMeta("body", bodyOrLocation) - } - return twerr -} - -func isHTTPRedirect(status int) bool { - return status >= 300 && status <= 399 -} - -// wrapInternal wraps an error with a prefix as an Internal error. -// The original error cause is accessible by github.com/pkg/errors.Cause. -func wrapInternal(err error, prefix string) twirp.Error { - return twirp.InternalErrorWith(&wrappedError{prefix: prefix, cause: err}) -} - -type wrappedError struct { - prefix string - cause error -} - -func (e *wrappedError) Error() string { return e.prefix + ": " + e.cause.Error() } -func (e *wrappedError) Unwrap() error { return e.cause } // for go1.13 + errors.Is/As -func (e *wrappedError) Cause() error { return e.cause } // for github.com/pkg/errors - -// ensurePanicResponses makes sure that rpc methods causing a panic still result in a Twirp Internal -// error response (status 500), and error hooks are properly called with the panic wrapped as an error. -// The panic is re-raised so it can be handled normally with middleware. -func ensurePanicResponses(ctx context.Context, resp http.ResponseWriter, hooks *twirp.ServerHooks) { - if r := recover(); r != nil { - // Wrap the panic as an error so it can be passed to error hooks. - // The original error is accessible from error hooks, but not visible in the response. - err := errFromPanic(r) - twerr := &internalWithCause{msg: "Internal service panic", cause: err} - // Actually write the error - writeError(ctx, resp, twerr, hooks) - // If possible, flush the error to the wire. - f, ok := resp.(http.Flusher) - if ok { - f.Flush() - } - - panic(r) - } -} - -// errFromPanic returns the typed error if the recovered panic is an error, otherwise formats as error. -func errFromPanic(p interface{}) error { - if err, ok := p.(error); ok { - return err - } - return fmt.Errorf("panic: %v", p) -} - -// internalWithCause is a Twirp Internal error wrapping an original error cause, -// but the original error message is not exposed on Msg(). The original error -// can be checked with go1.13+ errors.Is/As, and also by (github.com/pkg/errors).Unwrap -type internalWithCause struct { - msg string - cause error -} - -func (e *internalWithCause) Unwrap() error { return e.cause } // for go1.13 + errors.Is/As -func (e *internalWithCause) Cause() error { return e.cause } // for github.com/pkg/errors -func (e *internalWithCause) Error() string { return e.msg + ": " + e.cause.Error() } -func (e *internalWithCause) Code() twirp.ErrorCode { return twirp.Internal } -func (e *internalWithCause) Msg() string { return e.msg } -func (e *internalWithCause) Meta(key string) string { return "" } -func (e *internalWithCause) MetaMap() map[string]string { return nil } -func (e *internalWithCause) WithMeta(key string, val string) twirp.Error { return e } - -// malformedRequestError is used when the twirp server cannot unmarshal a request -func malformedRequestError(msg string) twirp.Error { - return twirp.NewError(twirp.Malformed, msg) -} - -// badRouteError is used when the twirp server cannot route a request -func badRouteError(msg string, method, url string) twirp.Error { - err := twirp.NewError(twirp.BadRoute, msg) - err = err.WithMeta("twirp_invalid_route", method+" "+url) - return err -} - -// withoutRedirects makes sure that the POST request can not be redirected. -// The standard library will, by default, redirect requests (including POSTs) if it gets a 302 or -// 303 response, and also 301s in go1.8. It redirects by making a second request, changing the -// method to GET and removing the body. This produces very confusing error messages, so instead we -// set a redirect policy that always errors. This stops Go from executing the redirect. -// -// We have to be a little careful in case the user-provided http.Client has its own CheckRedirect -// policy - if so, we'll run through that policy first. -// -// Because this requires modifying the http.Client, we make a new copy of the client and return it. -func withoutRedirects(in *http.Client) *http.Client { - copy := *in - copy.CheckRedirect = func(req *http.Request, via []*http.Request) error { - if in.CheckRedirect != nil { - // Run the input's redirect if it exists, in case it has side effects, but ignore any error it - // returns, since we want to use ErrUseLastResponse. - err := in.CheckRedirect(req, via) - _ = err // Silly, but this makes sure generated code passes errcheck -blank, which some people use. - } - return http.ErrUseLastResponse - } - return © -} - -// doProtobufRequest makes a Protobuf request to the remote Twirp service. -func doProtobufRequest(ctx context.Context, client HTTPClient, hooks *twirp.ClientHooks, url string, in, out proto.Message) (_ context.Context, err error) { - reqBodyBytes, err := proto.Marshal(in) - if err != nil { - return ctx, wrapInternal(err, "failed to marshal proto request") - } - reqBody := bytes.NewBuffer(reqBodyBytes) - if err = ctx.Err(); err != nil { - return ctx, wrapInternal(err, "aborted because context was done") - } - - req, err := newRequest(ctx, url, reqBody, "application/protobuf") - if err != nil { - return ctx, wrapInternal(err, "could not build request") - } - ctx, err = callClientRequestPrepared(ctx, hooks, req) - if err != nil { - return ctx, err - } - - req = req.WithContext(ctx) - resp, err := client.Do(req) - if err != nil { - return ctx, wrapInternal(err, "failed to do request") - } - - defer func() { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = wrapInternal(cerr, "failed to close response body") - } - }() - - if err = ctx.Err(); err != nil { - return ctx, wrapInternal(err, "aborted because context was done") - } - - if resp.StatusCode != 200 { - return ctx, errorFromResponse(resp) - } - - respBodyBytes, err := ioutil.ReadAll(resp.Body) - if err != nil { - return ctx, wrapInternal(err, "failed to read response body") - } - if err = ctx.Err(); err != nil { - return ctx, wrapInternal(err, "aborted because context was done") - } - - if err = proto.Unmarshal(respBodyBytes, out); err != nil { - return ctx, wrapInternal(err, "failed to unmarshal proto response") - } - return ctx, nil -} - -// doJSONRequest makes a JSON request to the remote Twirp service. -func doJSONRequest(ctx context.Context, client HTTPClient, hooks *twirp.ClientHooks, url string, in, out proto.Message) (_ context.Context, err error) { - reqBody := bytes.NewBuffer(nil) - marshaler := &jsonpb.Marshaler{OrigName: true} - if err = marshaler.Marshal(reqBody, in); err != nil { - return ctx, wrapInternal(err, "failed to marshal json request") - } - if err = ctx.Err(); err != nil { - return ctx, wrapInternal(err, "aborted because context was done") - } - - req, err := newRequest(ctx, url, reqBody, "application/json") - if err != nil { - return ctx, wrapInternal(err, "could not build request") - } - ctx, err = callClientRequestPrepared(ctx, hooks, req) - if err != nil { - return ctx, err - } - - req = req.WithContext(ctx) - resp, err := client.Do(req) - if err != nil { - return ctx, wrapInternal(err, "failed to do request") - } - - defer func() { - cerr := resp.Body.Close() - if err == nil && cerr != nil { - err = wrapInternal(cerr, "failed to close response body") - } - }() - - if err = ctx.Err(); err != nil { - return ctx, wrapInternal(err, "aborted because context was done") - } - - if resp.StatusCode != 200 { - return ctx, errorFromResponse(resp) - } - - unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true} - if err = unmarshaler.Unmarshal(resp.Body, out); err != nil { - return ctx, wrapInternal(err, "failed to unmarshal json response") - } - if err = ctx.Err(); err != nil { - return ctx, wrapInternal(err, "aborted because context was done") - } - return ctx, nil -} - -// Call twirp.ServerHooks.RequestReceived if the hook is available -func callRequestReceived(ctx context.Context, h *twirp.ServerHooks) (context.Context, error) { - if h == nil || h.RequestReceived == nil { - return ctx, nil - } - return h.RequestReceived(ctx) -} - -// Call twirp.ServerHooks.RequestRouted if the hook is available -func callRequestRouted(ctx context.Context, h *twirp.ServerHooks) (context.Context, error) { - if h == nil || h.RequestRouted == nil { - return ctx, nil - } - return h.RequestRouted(ctx) -} - -// Call twirp.ServerHooks.ResponsePrepared if the hook is available -func callResponsePrepared(ctx context.Context, h *twirp.ServerHooks) context.Context { - if h == nil || h.ResponsePrepared == nil { - return ctx - } - return h.ResponsePrepared(ctx) -} - -// Call twirp.ServerHooks.ResponseSent if the hook is available -func callResponseSent(ctx context.Context, h *twirp.ServerHooks) { - if h == nil || h.ResponseSent == nil { - return - } - h.ResponseSent(ctx) -} - -// Call twirp.ServerHooks.Error if the hook is available -func callError(ctx context.Context, h *twirp.ServerHooks, err twirp.Error) context.Context { - if h == nil || h.Error == nil { - return ctx - } - return h.Error(ctx, err) -} - -func callClientResponseReceived(ctx context.Context, h *twirp.ClientHooks) { - if h == nil || h.ResponseReceived == nil { - return - } - h.ResponseReceived(ctx) -} - -func callClientRequestPrepared(ctx context.Context, h *twirp.ClientHooks, req *http.Request) (context.Context, error) { - if h == nil || h.RequestPrepared == nil { - return ctx, nil - } - return h.RequestPrepared(ctx, req) -} - -func callClientError(ctx context.Context, h *twirp.ClientHooks, err twirp.Error) { - if h == nil || h.Error == nil { - return - } - h.Error(ctx, err) -} - -var twirpFileDescriptor0 = []byte{ - // 549 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xdf, 0x6f, 0x12, 0x41, - 0x10, 0x0e, 0xb6, 0xb4, 0x30, 0x14, 0x2d, 0x13, 0x0c, 0xd7, 0x23, 0x1a, 0x3c, 0x1f, 0xc4, 0x87, - 0x42, 0xc4, 0x07, 0x7d, 0xf0, 0xc5, 0xaa, 0x31, 0x24, 0x35, 0x69, 0x8e, 0x26, 0xfe, 0x78, 0x21, - 0x07, 0x37, 0xda, 0x4d, 0xd9, 0x5b, 0xbc, 0xdb, 0x23, 0xe5, 0xbf, 0xf0, 0xcf, 0xf0, 0xcf, 0x34, - 0xbb, 0x7b, 0x1c, 0x4b, 0x39, 0x88, 0x4f, 0xdc, 0xce, 0x7c, 0x33, 0xdf, 0x37, 0xb3, 0xdf, 0x02, - 0x10, 0x0b, 0xc1, 0x7b, 0xf3, 0x58, 0x48, 0x81, 0xc7, 0x33, 0xb6, 0xa0, 0x5b, 0x26, 0xdd, 0x1a, - 0x17, 0x21, 0xcd, 0x4c, 0xd4, 0xfb, 0x53, 0x82, 0xc6, 0x87, 0x98, 0x02, 0x49, 0xbe, 0x10, 0xdc, - 0xa7, 0xdf, 0x29, 0x25, 0x12, 0x11, 0x0e, 0xa3, 0x80, 0x93, 0x53, 0xea, 0x94, 0xba, 0x55, 0x5f, - 0x7f, 0xe3, 0x73, 0xa8, 0x13, 0x9f, 0xcb, 0xe5, 0x58, 0x32, 0x4e, 0x22, 0x95, 0xce, 0x83, 0x4e, - 0xa9, 0x5b, 0xf7, 0x4f, 0x74, 0xf0, 0xda, 0xc4, 0xf0, 0x25, 0x9c, 0xf2, 0xe0, 0x6e, 0x3c, 0x0f, - 0x62, 0xc9, 0xa6, 0x6c, 0x1e, 0x44, 0x32, 0x71, 0x0e, 0x34, 0xee, 0x11, 0x0f, 0xee, 0xae, 0xac, - 0x30, 0xb6, 0xe0, 0x38, 0x12, 0x21, 0x8d, 0x59, 0xe8, 0x1c, 0x6a, 0x9a, 0x23, 0x75, 0x1c, 0x86, - 0x1e, 0xc2, 0xe9, 0x25, 0x4b, 0xa4, 0xd2, 0x93, 0x64, 0x82, 0xbc, 0xb7, 0xd0, 0xb0, 0x62, 0xc9, - 0x5c, 0x44, 0x89, 0x52, 0x54, 0x56, 0xf3, 0x25, 0x4e, 0xa9, 0x73, 0xd0, 0xad, 0x0d, 0xea, 0xbd, - 0x6c, 0xc2, 0x9e, 0x1e, 0xc5, 0xe4, 0xbc, 0x17, 0xd0, 0xf8, 0x48, 0x33, 0xda, 0x9a, 0x4f, 0x65, - 0x57, 0xf3, 0xa9, 0x6f, 0xaf, 0x09, 0x68, 0x03, 0x0d, 0x87, 0x77, 0x0e, 0x2d, 0x45, 0x6c, 0x2b, - 0xdf, 0xd7, 0xe4, 0x1b, 0x38, 0xdb, 0xf0, 0x4c, 0xee, 0x3b, 0x38, 0xd9, 0xd8, 0x8b, 0x51, 0xed, - 0xe4, 0xaa, 0xad, 0xa2, 0x61, 0xf4, 0x53, 0xf8, 0x1b, 0x68, 0x6f, 0x08, 0x2d, 0x25, 0xcc, 0x06, - 0x85, 0x14, 0x49, 0x26, 0x97, 0x45, 0x42, 0xd0, 0x85, 0x0a, 0xcb, 0xf2, 0xfa, 0xa2, 0xaa, 0x7e, - 0x7e, 0xf6, 0xda, 0x70, 0xe6, 0x13, 0x17, 0x0b, 0xb2, 0x9a, 0xe5, 0x03, 0x2f, 0xa1, 0xf9, 0x25, - 0x35, 0x4b, 0xb8, 0x8e, 0x83, 0xe9, 0xed, 0x9e, 0x69, 0xf7, 0x91, 0x60, 0x1b, 0xaa, 0x52, 0xd5, - 0x8f, 0x13, 0x16, 0x6a, 0x0b, 0x54, 0xfd, 0x8a, 0x0e, 0x8c, 0x58, 0x88, 0x4d, 0x28, 0xf3, 0x54, - 0x92, 0xb9, 0xf9, 0x8a, 0x6f, 0x0e, 0xde, 0x7b, 0x78, 0x7c, 0x8f, 0x3a, 0xdb, 0x5c, 0x17, 0xca, - 0xba, 0x54, 0x93, 0xd7, 0x06, 0x98, 0xaf, 0x4c, 0xc3, 0xf4, 0xb2, 0x0c, 0x60, 0xf0, 0xf7, 0x10, - 0x6a, 0xaa, 0x7e, 0x44, 0xf1, 0x82, 0x4d, 0x09, 0xdf, 0x00, 0xac, 0xdd, 0x8d, 0x6e, 0x5e, 0xb8, - 0x65, 0x79, 0x77, 0xd3, 0x3d, 0x78, 0x01, 0xd5, 0xdc, 0x70, 0x78, 0x96, 0xe7, 0xee, 0x1b, 0xd3, - 0x75, 0x8b, 0x52, 0x99, 0xec, 0x4f, 0x00, 0x6b, 0x47, 0x59, 0xe4, 0x5b, 0x7e, 0x74, 0xdb, 0x85, - 0xb9, 0xac, 0xcd, 0x57, 0xf3, 0x1e, 0x36, 0x1e, 0x4f, 0x67, 0x83, 0xb6, 0xc0, 0x9d, 0xee, 0xb3, - 0x3d, 0x88, 0xac, 0xf1, 0x25, 0x3c, 0xfc, 0x4c, 0x76, 0xca, 0x6a, 0xbb, 0xc3, 0x6b, 0xee, 0x4e, - 0xbb, 0xe2, 0x77, 0x68, 0x6c, 0xb9, 0xea, 0x3f, 0x1a, 0x7a, 0x6b, 0xc4, 0x2e, 0x4f, 0xe2, 0x08, - 0x50, 0x19, 0xe3, 0x2a, 0x9d, 0xcc, 0x58, 0x72, 0x43, 0xa1, 0xbe, 0x76, 0x7c, 0x92, 0x57, 0x16, - 0x19, 0xd6, 0x7d, 0xba, 0x2b, 0x6d, 0x9a, 0x5e, 0xbc, 0xfa, 0xd1, 0xff, 0xc5, 0xe4, 0x4d, 0x3a, - 0xe9, 0x4d, 0x05, 0xef, 0x67, 0xd8, 0xd5, 0xef, 0x79, 0x42, 0xf1, 0x82, 0xe2, 0xbe, 0xfe, 0x93, - 0x5c, 0x05, 0x27, 0x47, 0xfa, 0xf8, 0xfa, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x99, 0x66, 0x2b, - 0xf4, 0x57, 0x05, 0x00, 0x00, -} diff --git a/proto/livekit/rtc.pb.go b/proto/livekit/rtc.pb.go deleted file mode 100644 index fa012e124..000000000 --- a/proto/livekit/rtc.pb.go +++ /dev/null @@ -1,1540 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.15.3 -// source: rtc.proto - -package livekit - -import ( - 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) -) - -type SignalTarget int32 - -const ( - SignalTarget_PUBLISHER SignalTarget = 0 - SignalTarget_SUBSCRIBER SignalTarget = 1 -) - -// Enum value maps for SignalTarget. -var ( - SignalTarget_name = map[int32]string{ - 0: "PUBLISHER", - 1: "SUBSCRIBER", - } - SignalTarget_value = map[string]int32{ - "PUBLISHER": 0, - "SUBSCRIBER": 1, - } -) - -func (x SignalTarget) Enum() *SignalTarget { - p := new(SignalTarget) - *p = x - return p -} - -func (x SignalTarget) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SignalTarget) Descriptor() protoreflect.EnumDescriptor { - return file_rtc_proto_enumTypes[0].Descriptor() -} - -func (SignalTarget) Type() protoreflect.EnumType { - return &file_rtc_proto_enumTypes[0] -} - -func (x SignalTarget) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SignalTarget.Descriptor instead. -func (SignalTarget) EnumDescriptor() ([]byte, []int) { - return file_rtc_proto_rawDescGZIP(), []int{0} -} - -type VideoQuality int32 - -const ( - VideoQuality_LOW VideoQuality = 0 - VideoQuality_MEDIUM VideoQuality = 1 - VideoQuality_HIGH VideoQuality = 2 -) - -// Enum value maps for VideoQuality. -var ( - VideoQuality_name = map[int32]string{ - 0: "LOW", - 1: "MEDIUM", - 2: "HIGH", - } - VideoQuality_value = map[string]int32{ - "LOW": 0, - "MEDIUM": 1, - "HIGH": 2, - } -) - -func (x VideoQuality) Enum() *VideoQuality { - p := new(VideoQuality) - *p = x - return p -} - -func (x VideoQuality) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (VideoQuality) Descriptor() protoreflect.EnumDescriptor { - return file_rtc_proto_enumTypes[1].Descriptor() -} - -func (VideoQuality) Type() protoreflect.EnumType { - return &file_rtc_proto_enumTypes[1] -} - -func (x VideoQuality) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use VideoQuality.Descriptor instead. -func (VideoQuality) EnumDescriptor() ([]byte, []int) { - return file_rtc_proto_rawDescGZIP(), []int{1} -} - -type SignalRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Message: - // *SignalRequest_Offer - // *SignalRequest_Answer - // *SignalRequest_Trickle - // *SignalRequest_AddTrack - // *SignalRequest_Mute - // *SignalRequest_Subscription - // *SignalRequest_TrackSetting - Message isSignalRequest_Message `protobuf_oneof:"message"` -} - -func (x *SignalRequest) Reset() { - *x = SignalRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_rtc_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignalRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignalRequest) ProtoMessage() {} - -func (x *SignalRequest) ProtoReflect() protoreflect.Message { - mi := &file_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) -} - -// Deprecated: Use SignalRequest.ProtoReflect.Descriptor instead. -func (*SignalRequest) Descriptor() ([]byte, []int) { - return file_rtc_proto_rawDescGZIP(), []int{0} -} - -func (m *SignalRequest) GetMessage() isSignalRequest_Message { - if m != nil { - return m.Message - } - return nil -} - -func (x *SignalRequest) GetOffer() *SessionDescription { - if x, ok := x.GetMessage().(*SignalRequest_Offer); ok { - return x.Offer - } - return nil -} - -func (x *SignalRequest) GetAnswer() *SessionDescription { - if x, ok := x.GetMessage().(*SignalRequest_Answer); ok { - return x.Answer - } - return nil -} - -func (x *SignalRequest) GetTrickle() *TrickleRequest { - if x, ok := x.GetMessage().(*SignalRequest_Trickle); ok { - return x.Trickle - } - return nil -} - -func (x *SignalRequest) GetAddTrack() *AddTrackRequest { - if x, ok := x.GetMessage().(*SignalRequest_AddTrack); ok { - return x.AddTrack - } - return nil -} - -func (x *SignalRequest) GetMute() *MuteTrackRequest { - if x, ok := x.GetMessage().(*SignalRequest_Mute); ok { - return x.Mute - } - return nil -} - -func (x *SignalRequest) GetSubscription() *UpdateSubscription { - if x, ok := x.GetMessage().(*SignalRequest_Subscription); ok { - return x.Subscription - } - return nil -} - -func (x *SignalRequest) GetTrackSetting() *UpdateTrackSettings { - if x, ok := x.GetMessage().(*SignalRequest_TrackSetting); ok { - return x.TrackSetting - } - return nil -} - -type isSignalRequest_Message interface { - isSignalRequest_Message() -} - -type SignalRequest_Offer struct { - // initial join exchange, for publisher - Offer *SessionDescription `protobuf:"bytes,1,opt,name=offer,proto3,oneof"` -} - -type SignalRequest_Answer struct { - // participant answering publisher offer - Answer *SessionDescription `protobuf:"bytes,2,opt,name=answer,proto3,oneof"` -} - -type SignalRequest_Trickle struct { - Trickle *TrickleRequest `protobuf:"bytes,3,opt,name=trickle,proto3,oneof"` -} - -type SignalRequest_AddTrack struct { - AddTrack *AddTrackRequest `protobuf:"bytes,4,opt,name=add_track,json=addTrack,proto3,oneof"` -} - -type SignalRequest_Mute struct { - // mute the participant's own tracks - Mute *MuteTrackRequest `protobuf:"bytes,5,opt,name=mute,proto3,oneof"` -} - -type SignalRequest_Subscription struct { - // Subscribe or unsubscribe from tracks - Subscription *UpdateSubscription `protobuf:"bytes,6,opt,name=subscription,proto3,oneof"` -} - -type SignalRequest_TrackSetting struct { - // Update settings of subscribed tracks - TrackSetting *UpdateTrackSettings `protobuf:"bytes,7,opt,name=track_setting,json=trackSetting,proto3,oneof"` -} - -func (*SignalRequest_Offer) isSignalRequest_Message() {} - -func (*SignalRequest_Answer) isSignalRequest_Message() {} - -func (*SignalRequest_Trickle) isSignalRequest_Message() {} - -func (*SignalRequest_AddTrack) isSignalRequest_Message() {} - -func (*SignalRequest_Mute) isSignalRequest_Message() {} - -func (*SignalRequest_Subscription) isSignalRequest_Message() {} - -func (*SignalRequest_TrackSetting) isSignalRequest_Message() {} - -type SignalResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Message: - // *SignalResponse_Join - // *SignalResponse_Answer - // *SignalResponse_Offer - // *SignalResponse_Trickle - // *SignalResponse_Update - // *SignalResponse_TrackPublished - // *SignalResponse_Speaker - Message isSignalResponse_Message `protobuf_oneof:"message"` -} - -func (x *SignalResponse) Reset() { - *x = SignalResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_rtc_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignalResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignalResponse) ProtoMessage() {} - -func (x *SignalResponse) ProtoReflect() protoreflect.Message { - mi := &file_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 - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignalResponse.ProtoReflect.Descriptor instead. -func (*SignalResponse) Descriptor() ([]byte, []int) { - return file_rtc_proto_rawDescGZIP(), []int{1} -} - -func (m *SignalResponse) GetMessage() isSignalResponse_Message { - if m != nil { - return m.Message - } - return nil -} - -func (x *SignalResponse) GetJoin() *JoinResponse { - if x, ok := x.GetMessage().(*SignalResponse_Join); ok { - return x.Join - } - return nil -} - -func (x *SignalResponse) GetAnswer() *SessionDescription { - if x, ok := x.GetMessage().(*SignalResponse_Answer); ok { - return x.Answer - } - return nil -} - -func (x *SignalResponse) GetOffer() *SessionDescription { - if x, ok := x.GetMessage().(*SignalResponse_Offer); ok { - return x.Offer - } - return nil -} - -func (x *SignalResponse) GetTrickle() *TrickleRequest { - if x, ok := x.GetMessage().(*SignalResponse_Trickle); ok { - return x.Trickle - } - return nil -} - -func (x *SignalResponse) GetUpdate() *ParticipantUpdate { - if x, ok := x.GetMessage().(*SignalResponse_Update); ok { - return x.Update - } - return nil -} - -func (x *SignalResponse) GetTrackPublished() *TrackPublishedResponse { - if x, ok := x.GetMessage().(*SignalResponse_TrackPublished); ok { - return x.TrackPublished - } - return nil -} - -func (x *SignalResponse) GetSpeaker() *ActiveSpeakerUpdate { - if x, ok := x.GetMessage().(*SignalResponse_Speaker); ok { - return x.Speaker - } - return nil -} - -type isSignalResponse_Message interface { - isSignalResponse_Message() -} - -type SignalResponse_Join struct { - // sent when join is accepted - Join *JoinResponse `protobuf:"bytes,1,opt,name=join,proto3,oneof"` -} - -type SignalResponse_Answer struct { - // sent when server answers publisher - Answer *SessionDescription `protobuf:"bytes,2,opt,name=answer,proto3,oneof"` -} - -type SignalResponse_Offer struct { - // sent when server is sending subscriber an offer - Offer *SessionDescription `protobuf:"bytes,3,opt,name=offer,proto3,oneof"` -} - -type SignalResponse_Trickle struct { - // sent when an ICE candidate is available - Trickle *TrickleRequest `protobuf:"bytes,4,opt,name=trickle,proto3,oneof"` -} - -type SignalResponse_Update struct { - // sent when participants in the room has changed - Update *ParticipantUpdate `protobuf:"bytes,5,opt,name=update,proto3,oneof"` -} - -type SignalResponse_TrackPublished struct { - // sent to the participant when their track has been published - TrackPublished *TrackPublishedResponse `protobuf:"bytes,6,opt,name=track_published,json=trackPublished,proto3,oneof"` -} - -type SignalResponse_Speaker struct { - // list of active speakers - Speaker *ActiveSpeakerUpdate `protobuf:"bytes,7,opt,name=speaker,proto3,oneof"` -} - -func (*SignalResponse_Join) isSignalResponse_Message() {} - -func (*SignalResponse_Answer) isSignalResponse_Message() {} - -func (*SignalResponse_Offer) isSignalResponse_Message() {} - -func (*SignalResponse_Trickle) isSignalResponse_Message() {} - -func (*SignalResponse_Update) isSignalResponse_Message() {} - -func (*SignalResponse_TrackPublished) isSignalResponse_Message() {} - -func (*SignalResponse_Speaker) isSignalResponse_Message() {} - -type AddTrackRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // client ID of track, to match it when RTC track is received - Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Type TrackType `protobuf:"varint,3,opt,name=type,proto3,enum=livekit.TrackType" json:"type,omitempty"` -} - -func (x *AddTrackRequest) Reset() { - *x = AddTrackRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_rtc_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddTrackRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddTrackRequest) ProtoMessage() {} - -func (x *AddTrackRequest) ProtoReflect() protoreflect.Message { - mi := &file_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) -} - -// Deprecated: Use AddTrackRequest.ProtoReflect.Descriptor instead. -func (*AddTrackRequest) Descriptor() ([]byte, []int) { - return file_rtc_proto_rawDescGZIP(), []int{2} -} - -func (x *AddTrackRequest) GetCid() string { - if x != nil { - return x.Cid - } - return "" -} - -func (x *AddTrackRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *AddTrackRequest) GetType() TrackType { - if x != nil { - return x.Type - } - return TrackType_AUDIO -} - -type TrickleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - CandidateInit string `protobuf:"bytes,1,opt,name=candidateInit,proto3" json:"candidateInit,omitempty"` - Target SignalTarget `protobuf:"varint,2,opt,name=target,proto3,enum=livekit.SignalTarget" json:"target,omitempty"` -} - -func (x *TrickleRequest) Reset() { - *x = TrickleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_rtc_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TrickleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TrickleRequest) ProtoMessage() {} - -func (x *TrickleRequest) ProtoReflect() protoreflect.Message { - mi := &file_rtc_proto_msgTypes[3] - 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 TrickleRequest.ProtoReflect.Descriptor instead. -func (*TrickleRequest) Descriptor() ([]byte, []int) { - return file_rtc_proto_rawDescGZIP(), []int{3} -} - -func (x *TrickleRequest) GetCandidateInit() string { - if x != nil { - return x.CandidateInit - } - return "" -} - -func (x *TrickleRequest) GetTarget() SignalTarget { - if x != nil { - return x.Target - } - return SignalTarget_PUBLISHER -} - -type MuteTrackRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"` - Muted bool `protobuf:"varint,2,opt,name=muted,proto3" json:"muted,omitempty"` -} - -func (x *MuteTrackRequest) Reset() { - *x = MuteTrackRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_rtc_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MuteTrackRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MuteTrackRequest) ProtoMessage() {} - -func (x *MuteTrackRequest) ProtoReflect() protoreflect.Message { - mi := &file_rtc_proto_msgTypes[4] - 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 MuteTrackRequest.ProtoReflect.Descriptor instead. -func (*MuteTrackRequest) Descriptor() ([]byte, []int) { - return file_rtc_proto_rawDescGZIP(), []int{4} -} - -func (x *MuteTrackRequest) GetSid() string { - if x != nil { - return x.Sid - } - return "" -} - -func (x *MuteTrackRequest) GetMuted() bool { - if x != nil { - return x.Muted - } - return false -} - -type NegotiationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *NegotiationRequest) Reset() { - *x = NegotiationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_rtc_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NegotiationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NegotiationRequest) ProtoMessage() {} - -func (x *NegotiationRequest) ProtoReflect() protoreflect.Message { - mi := &file_rtc_proto_msgTypes[5] - 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 NegotiationRequest.ProtoReflect.Descriptor instead. -func (*NegotiationRequest) Descriptor() ([]byte, []int) { - return file_rtc_proto_rawDescGZIP(), []int{5} -} - -type JoinResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Room *Room `protobuf:"bytes,1,opt,name=room,proto3" json:"room,omitempty"` - Participant *ParticipantInfo `protobuf:"bytes,2,opt,name=participant,proto3" json:"participant,omitempty"` - OtherParticipants []*ParticipantInfo `protobuf:"bytes,3,rep,name=other_participants,json=otherParticipants,proto3" json:"other_participants,omitempty"` - ServerVersion string `protobuf:"bytes,4,opt,name=server_version,json=serverVersion,proto3" json:"server_version,omitempty"` -} - -func (x *JoinResponse) Reset() { - *x = JoinResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_rtc_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *JoinResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JoinResponse) ProtoMessage() {} - -func (x *JoinResponse) ProtoReflect() protoreflect.Message { - mi := &file_rtc_proto_msgTypes[6] - 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 JoinResponse.ProtoReflect.Descriptor instead. -func (*JoinResponse) Descriptor() ([]byte, []int) { - return file_rtc_proto_rawDescGZIP(), []int{6} -} - -func (x *JoinResponse) GetRoom() *Room { - if x != nil { - return x.Room - } - return nil -} - -func (x *JoinResponse) GetParticipant() *ParticipantInfo { - if x != nil { - return x.Participant - } - return nil -} - -func (x *JoinResponse) GetOtherParticipants() []*ParticipantInfo { - if x != nil { - return x.OtherParticipants - } - return nil -} - -func (x *JoinResponse) GetServerVersion() string { - if x != nil { - return x.ServerVersion - } - return "" -} - -type TrackPublishedResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` - Track *TrackInfo `protobuf:"bytes,2,opt,name=track,proto3" json:"track,omitempty"` -} - -func (x *TrackPublishedResponse) Reset() { - *x = TrackPublishedResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_rtc_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TrackPublishedResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TrackPublishedResponse) ProtoMessage() {} - -func (x *TrackPublishedResponse) ProtoReflect() protoreflect.Message { - mi := &file_rtc_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 TrackPublishedResponse.ProtoReflect.Descriptor instead. -func (*TrackPublishedResponse) Descriptor() ([]byte, []int) { - return file_rtc_proto_rawDescGZIP(), []int{7} -} - -func (x *TrackPublishedResponse) GetCid() string { - if x != nil { - return x.Cid - } - return "" -} - -func (x *TrackPublishedResponse) GetTrack() *TrackInfo { - if x != nil { - return x.Track - } - return nil -} - -type SessionDescription struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // "answer" | "offer" | "pranswer" | "rollback" - Sdp string `protobuf:"bytes,2,opt,name=sdp,proto3" json:"sdp,omitempty"` -} - -func (x *SessionDescription) Reset() { - *x = SessionDescription{} - if protoimpl.UnsafeEnabled { - mi := &file_rtc_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SessionDescription) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SessionDescription) ProtoMessage() {} - -func (x *SessionDescription) ProtoReflect() protoreflect.Message { - mi := &file_rtc_proto_msgTypes[8] - 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 SessionDescription.ProtoReflect.Descriptor instead. -func (*SessionDescription) Descriptor() ([]byte, []int) { - return file_rtc_proto_rawDescGZIP(), []int{8} -} - -func (x *SessionDescription) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *SessionDescription) GetSdp() string { - if x != nil { - return x.Sdp - } - return "" -} - -type ParticipantUpdate struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Participants []*ParticipantInfo `protobuf:"bytes,1,rep,name=participants,proto3" json:"participants,omitempty"` -} - -func (x *ParticipantUpdate) Reset() { - *x = ParticipantUpdate{} - if protoimpl.UnsafeEnabled { - mi := &file_rtc_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ParticipantUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ParticipantUpdate) ProtoMessage() {} - -func (x *ParticipantUpdate) ProtoReflect() protoreflect.Message { - mi := &file_rtc_proto_msgTypes[9] - 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 ParticipantUpdate.ProtoReflect.Descriptor instead. -func (*ParticipantUpdate) Descriptor() ([]byte, []int) { - return file_rtc_proto_rawDescGZIP(), []int{9} -} - -func (x *ParticipantUpdate) GetParticipants() []*ParticipantInfo { - if x != nil { - return x.Participants - } - return nil -} - -type ActiveSpeakerUpdate struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Speakers []*SpeakerInfo `protobuf:"bytes,1,rep,name=speakers,proto3" json:"speakers,omitempty"` -} - -func (x *ActiveSpeakerUpdate) Reset() { - *x = ActiveSpeakerUpdate{} - if protoimpl.UnsafeEnabled { - mi := &file_rtc_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ActiveSpeakerUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ActiveSpeakerUpdate) ProtoMessage() {} - -func (x *ActiveSpeakerUpdate) ProtoReflect() protoreflect.Message { - mi := &file_rtc_proto_msgTypes[10] - 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 ActiveSpeakerUpdate.ProtoReflect.Descriptor instead. -func (*ActiveSpeakerUpdate) Descriptor() ([]byte, []int) { - return file_rtc_proto_rawDescGZIP(), []int{10} -} - -func (x *ActiveSpeakerUpdate) GetSpeakers() []*SpeakerInfo { - if x != nil { - return x.Speakers - } - return nil -} - -type SpeakerInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"` - // audio level, 0-1.0, 1 is loudest - Level float32 `protobuf:"fixed32,2,opt,name=level,proto3" json:"level,omitempty"` - // true if speaker is currently active - Active bool `protobuf:"varint,3,opt,name=active,proto3" json:"active,omitempty"` -} - -func (x *SpeakerInfo) Reset() { - *x = SpeakerInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_rtc_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SpeakerInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SpeakerInfo) ProtoMessage() {} - -func (x *SpeakerInfo) ProtoReflect() protoreflect.Message { - mi := &file_rtc_proto_msgTypes[11] - 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 SpeakerInfo.ProtoReflect.Descriptor instead. -func (*SpeakerInfo) Descriptor() ([]byte, []int) { - return file_rtc_proto_rawDescGZIP(), []int{11} -} - -func (x *SpeakerInfo) GetSid() string { - if x != nil { - return x.Sid - } - return "" -} - -func (x *SpeakerInfo) GetLevel() float32 { - if x != nil { - return x.Level - } - return 0 -} - -func (x *SpeakerInfo) GetActive() bool { - if x != nil { - return x.Active - } - return false -} - -type UpdateSubscription struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - TrackSids []string `protobuf:"bytes,1,rep,name=track_sids,json=trackSids,proto3" json:"track_sids,omitempty"` - Subscribe bool `protobuf:"varint,2,opt,name=subscribe,proto3" json:"subscribe,omitempty"` - Mute bool `protobuf:"varint,3,opt,name=mute,proto3" json:"mute,omitempty"` - Quality VideoQuality `protobuf:"varint,4,opt,name=quality,proto3,enum=livekit.VideoQuality" json:"quality,omitempty"` -} - -func (x *UpdateSubscription) Reset() { - *x = UpdateSubscription{} - if protoimpl.UnsafeEnabled { - mi := &file_rtc_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateSubscription) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateSubscription) ProtoMessage() {} - -func (x *UpdateSubscription) ProtoReflect() protoreflect.Message { - mi := &file_rtc_proto_msgTypes[12] - 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 UpdateSubscription.ProtoReflect.Descriptor instead. -func (*UpdateSubscription) Descriptor() ([]byte, []int) { - return file_rtc_proto_rawDescGZIP(), []int{12} -} - -func (x *UpdateSubscription) GetTrackSids() []string { - if x != nil { - return x.TrackSids - } - return nil -} - -func (x *UpdateSubscription) GetSubscribe() bool { - if x != nil { - return x.Subscribe - } - return false -} - -func (x *UpdateSubscription) GetMute() bool { - if x != nil { - return x.Mute - } - return false -} - -func (x *UpdateSubscription) GetQuality() VideoQuality { - if x != nil { - return x.Quality - } - return VideoQuality_LOW -} - -type UpdateTrackSettings struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - TrackSids []string `protobuf:"bytes,1,rep,name=track_sids,json=trackSids,proto3" json:"track_sids,omitempty"` - Mute bool `protobuf:"varint,3,opt,name=mute,proto3" json:"mute,omitempty"` - Quality VideoQuality `protobuf:"varint,4,opt,name=quality,proto3,enum=livekit.VideoQuality" json:"quality,omitempty"` -} - -func (x *UpdateTrackSettings) Reset() { - *x = UpdateTrackSettings{} - if protoimpl.UnsafeEnabled { - mi := &file_rtc_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateTrackSettings) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateTrackSettings) ProtoMessage() {} - -func (x *UpdateTrackSettings) ProtoReflect() protoreflect.Message { - mi := &file_rtc_proto_msgTypes[13] - 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 UpdateTrackSettings.ProtoReflect.Descriptor instead. -func (*UpdateTrackSettings) Descriptor() ([]byte, []int) { - return file_rtc_proto_rawDescGZIP(), []int{13} -} - -func (x *UpdateTrackSettings) GetTrackSids() []string { - if x != nil { - return x.TrackSids - } - return nil -} - -func (x *UpdateTrackSettings) GetMute() bool { - if x != nil { - return x.Mute - } - return false -} - -func (x *UpdateTrackSettings) GetQuality() VideoQuality { - if x != nil { - return x.Quality - } - return VideoQuality_LOW -} - -var File_rtc_proto protoreflect.FileDescriptor - -var file_rtc_proto_rawDesc = []byte{ - 0x0a, 0x09, 0x72, 0x74, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6c, 0x69, 0x76, - 0x65, 0x6b, 0x69, 0x74, 0x1a, 0x0b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0xad, 0x03, 0x0a, 0x0d, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x05, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x48, - 0x00, 0x52, 0x05, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x12, 0x35, 0x0a, 0x06, 0x61, 0x6e, 0x73, 0x77, - 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, - 0x69, 0x74, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, - 0x33, 0x0a, 0x07, 0x74, 0x72, 0x69, 0x63, 0x6b, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x17, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x54, 0x72, 0x69, 0x63, 0x6b, - 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x07, 0x74, 0x72, 0x69, - 0x63, 0x6b, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x5f, 0x74, 0x72, 0x61, 0x63, - 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, - 0x74, 0x2e, 0x41, 0x64, 0x64, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x48, 0x00, 0x52, 0x08, 0x61, 0x64, 0x64, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x12, 0x2f, 0x0a, - 0x04, 0x6d, 0x75, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6c, 0x69, - 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4d, 0x75, 0x74, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x04, 0x6d, 0x75, 0x74, 0x65, 0x12, 0x41, - 0x0a, 0x0c, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x43, 0x0a, 0x0d, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, - 0x69, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x48, 0x00, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x22, 0xa5, 0x03, 0x0a, 0x0e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x6a, 0x6f, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4a, 0x6f, 0x69, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x04, 0x6a, 0x6f, 0x69, - 0x6e, 0x12, 0x35, 0x0a, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1b, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, - 0x52, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x05, 0x6f, 0x66, 0x66, 0x65, - 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, - 0x74, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x05, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x12, 0x33, 0x0a, - 0x07, 0x74, 0x72, 0x69, 0x63, 0x6b, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x54, 0x72, 0x69, 0x63, 0x6b, 0x6c, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x07, 0x74, 0x72, 0x69, 0x63, 0x6b, - 0x6c, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x50, 0x61, 0x72, - 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x00, - 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x4a, 0x0a, 0x0f, 0x74, 0x72, 0x61, 0x63, - 0x6b, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1f, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x54, 0x72, 0x61, 0x63, - 0x6b, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x48, 0x00, 0x52, 0x0e, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x50, 0x75, 0x62, 0x6c, 0x69, - 0x73, 0x68, 0x65, 0x64, 0x12, 0x38, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, - 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x70, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x07, 0x73, 0x70, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x42, 0x09, - 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x5f, 0x0a, 0x0f, 0x41, 0x64, 0x64, - 0x54, 0x72, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, - 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x12, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x65, 0x0a, 0x0e, 0x54, 0x72, - 0x69, 0x63, 0x6b, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0d, - 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x69, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, - 0x69, 0x74, 0x12, 0x2d, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x6c, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x22, 0x3a, 0x0a, 0x10, 0x4d, 0x75, 0x74, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x73, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x75, 0x74, 0x65, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x6d, 0x75, 0x74, 0x65, 0x64, 0x22, 0x14, 0x0a, - 0x12, 0x4e, 0x65, 0x67, 0x6f, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0xdd, 0x01, 0x0a, 0x0c, 0x4a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x52, 0x6f, 0x6f, - 0x6d, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x6d, 0x12, 0x3a, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, - 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6c, - 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, - 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, - 0x61, 0x6e, 0x74, 0x12, 0x47, 0x0a, 0x12, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x72, - 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x18, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, - 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x11, 0x6f, 0x74, 0x68, 0x65, 0x72, - 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x25, 0x0a, 0x0e, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x22, 0x54, 0x0a, 0x16, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x50, 0x75, 0x62, 0x6c, - 0x69, 0x73, 0x68, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, - 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, - 0x28, 0x0a, 0x05, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, - 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x05, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x22, 0x3a, 0x0a, 0x12, 0x53, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x64, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x73, 0x64, 0x70, 0x22, 0x51, 0x0a, 0x11, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, - 0x70, 0x61, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x70, 0x61, - 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, - 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x74, - 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x22, 0x47, 0x0a, 0x13, 0x41, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x53, 0x70, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, - 0x30, 0x0a, 0x08, 0x73, 0x70, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x70, 0x65, 0x61, - 0x6b, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x73, 0x70, 0x65, 0x61, 0x6b, 0x65, 0x72, - 0x73, 0x22, 0x4d, 0x0a, 0x0b, 0x53, 0x70, 0x65, 0x61, 0x6b, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, - 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, - 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x02, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x22, 0x96, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x72, 0x61, 0x63, 0x6b, - 0x5f, 0x73, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x74, 0x72, 0x61, - 0x63, 0x6b, 0x53, 0x69, 0x64, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x62, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x62, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x75, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x04, 0x6d, 0x75, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x71, 0x75, 0x61, 0x6c, - 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x6c, 0x69, 0x76, 0x65, - 0x6b, 0x69, 0x74, 0x2e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x51, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, - 0x52, 0x07, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x22, 0x79, 0x0a, 0x13, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x5f, 0x73, 0x69, 0x64, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x69, 0x64, 0x73, 0x12, - 0x12, 0x0a, 0x04, 0x6d, 0x75, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6d, - 0x75, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x56, - 0x69, 0x64, 0x65, 0x6f, 0x51, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x07, 0x71, 0x75, 0x61, - 0x6c, 0x69, 0x74, 0x79, 0x2a, 0x2d, 0x0a, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x12, 0x0d, 0x0a, 0x09, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x53, 0x48, 0x45, - 0x52, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x55, 0x42, 0x53, 0x43, 0x52, 0x49, 0x42, 0x45, - 0x52, 0x10, 0x01, 0x2a, 0x2d, 0x0a, 0x0c, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x51, 0x75, 0x61, 0x6c, - 0x69, 0x74, 0x79, 0x12, 0x07, 0x0a, 0x03, 0x4c, 0x4f, 0x57, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, - 0x4d, 0x45, 0x44, 0x49, 0x55, 0x4d, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x49, 0x47, 0x48, - 0x10, 0x02, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, - 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6c, 0x69, - 0x76, 0x65, 0x6b, 0x69, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_rtc_proto_rawDescOnce sync.Once - file_rtc_proto_rawDescData = file_rtc_proto_rawDesc -) - -func file_rtc_proto_rawDescGZIP() []byte { - file_rtc_proto_rawDescOnce.Do(func() { - file_rtc_proto_rawDescData = protoimpl.X.CompressGZIP(file_rtc_proto_rawDescData) - }) - return file_rtc_proto_rawDescData -} - -var file_rtc_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_rtc_proto_msgTypes = make([]protoimpl.MessageInfo, 14) -var file_rtc_proto_goTypes = []interface{}{ - (SignalTarget)(0), // 0: livekit.SignalTarget - (VideoQuality)(0), // 1: livekit.VideoQuality - (*SignalRequest)(nil), // 2: livekit.SignalRequest - (*SignalResponse)(nil), // 3: livekit.SignalResponse - (*AddTrackRequest)(nil), // 4: livekit.AddTrackRequest - (*TrickleRequest)(nil), // 5: livekit.TrickleRequest - (*MuteTrackRequest)(nil), // 6: livekit.MuteTrackRequest - (*NegotiationRequest)(nil), // 7: livekit.NegotiationRequest - (*JoinResponse)(nil), // 8: livekit.JoinResponse - (*TrackPublishedResponse)(nil), // 9: livekit.TrackPublishedResponse - (*SessionDescription)(nil), // 10: livekit.SessionDescription - (*ParticipantUpdate)(nil), // 11: livekit.ParticipantUpdate - (*ActiveSpeakerUpdate)(nil), // 12: livekit.ActiveSpeakerUpdate - (*SpeakerInfo)(nil), // 13: livekit.SpeakerInfo - (*UpdateSubscription)(nil), // 14: livekit.UpdateSubscription - (*UpdateTrackSettings)(nil), // 15: livekit.UpdateTrackSettings - (TrackType)(0), // 16: livekit.TrackType - (*Room)(nil), // 17: livekit.Room - (*ParticipantInfo)(nil), // 18: livekit.ParticipantInfo - (*TrackInfo)(nil), // 19: livekit.TrackInfo -} -var file_rtc_proto_depIdxs = []int32{ - 10, // 0: livekit.SignalRequest.offer:type_name -> livekit.SessionDescription - 10, // 1: livekit.SignalRequest.answer:type_name -> livekit.SessionDescription - 5, // 2: livekit.SignalRequest.trickle:type_name -> livekit.TrickleRequest - 4, // 3: livekit.SignalRequest.add_track:type_name -> livekit.AddTrackRequest - 6, // 4: livekit.SignalRequest.mute:type_name -> livekit.MuteTrackRequest - 14, // 5: livekit.SignalRequest.subscription:type_name -> livekit.UpdateSubscription - 15, // 6: livekit.SignalRequest.track_setting:type_name -> livekit.UpdateTrackSettings - 8, // 7: livekit.SignalResponse.join:type_name -> livekit.JoinResponse - 10, // 8: livekit.SignalResponse.answer:type_name -> livekit.SessionDescription - 10, // 9: livekit.SignalResponse.offer:type_name -> livekit.SessionDescription - 5, // 10: livekit.SignalResponse.trickle:type_name -> livekit.TrickleRequest - 11, // 11: livekit.SignalResponse.update:type_name -> livekit.ParticipantUpdate - 9, // 12: livekit.SignalResponse.track_published:type_name -> livekit.TrackPublishedResponse - 12, // 13: livekit.SignalResponse.speaker:type_name -> livekit.ActiveSpeakerUpdate - 16, // 14: livekit.AddTrackRequest.type:type_name -> livekit.TrackType - 0, // 15: livekit.TrickleRequest.target:type_name -> livekit.SignalTarget - 17, // 16: livekit.JoinResponse.room:type_name -> livekit.Room - 18, // 17: livekit.JoinResponse.participant:type_name -> livekit.ParticipantInfo - 18, // 18: livekit.JoinResponse.other_participants:type_name -> livekit.ParticipantInfo - 19, // 19: livekit.TrackPublishedResponse.track:type_name -> livekit.TrackInfo - 18, // 20: livekit.ParticipantUpdate.participants:type_name -> livekit.ParticipantInfo - 13, // 21: livekit.ActiveSpeakerUpdate.speakers:type_name -> livekit.SpeakerInfo - 1, // 22: livekit.UpdateSubscription.quality:type_name -> livekit.VideoQuality - 1, // 23: livekit.UpdateTrackSettings.quality:type_name -> livekit.VideoQuality - 24, // [24:24] is the sub-list for method output_type - 24, // [24:24] is the sub-list for method input_type - 24, // [24:24] is the sub-list for extension type_name - 24, // [24:24] is the sub-list for extension extendee - 0, // [0:24] is the sub-list for field type_name -} - -func init() { file_rtc_proto_init() } -func file_rtc_proto_init() { - if File_rtc_proto != nil { - return - } - file_model_proto_init() - if !protoimpl.UnsafeEnabled { - file_rtc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignalRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rtc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignalResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rtc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddTrackRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rtc_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TrickleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rtc_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MuteTrackRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rtc_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NegotiationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rtc_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JoinResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rtc_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TrackPublishedResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rtc_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SessionDescription); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rtc_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ParticipantUpdate); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rtc_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ActiveSpeakerUpdate); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rtc_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SpeakerInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rtc_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateSubscription); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rtc_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateTrackSettings); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_rtc_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*SignalRequest_Offer)(nil), - (*SignalRequest_Answer)(nil), - (*SignalRequest_Trickle)(nil), - (*SignalRequest_AddTrack)(nil), - (*SignalRequest_Mute)(nil), - (*SignalRequest_Subscription)(nil), - (*SignalRequest_TrackSetting)(nil), - } - file_rtc_proto_msgTypes[1].OneofWrappers = []interface{}{ - (*SignalResponse_Join)(nil), - (*SignalResponse_Answer)(nil), - (*SignalResponse_Offer)(nil), - (*SignalResponse_Trickle)(nil), - (*SignalResponse_Update)(nil), - (*SignalResponse_TrackPublished)(nil), - (*SignalResponse_Speaker)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_rtc_proto_rawDesc, - NumEnums: 2, - NumMessages: 14, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_rtc_proto_goTypes, - DependencyIndexes: file_rtc_proto_depIdxs, - EnumInfos: file_rtc_proto_enumTypes, - MessageInfos: file_rtc_proto_msgTypes, - }.Build() - File_rtc_proto = out.File - file_rtc_proto_rawDesc = nil - file_rtc_proto_goTypes = nil - file_rtc_proto_depIdxs = nil -}