separated join from creation, room options & token

This commit is contained in:
David Zhao
2020-10-07 23:54:44 -07:00
parent 37984bd167
commit 6752c4a91d
13 changed files with 1127 additions and 757 deletions
+3 -2
View File
@@ -15,11 +15,12 @@ server: generate
} }
generate: wire generate: wire
go generate $(WIRE)
GO_TARGET=proto GO_TARGET=proto/livekit
proto: protoc protoc-gen-go twirp-gen proto: protoc protoc-gen-go twirp-gen
@{ \ @{ \
mkdir -p $(GO_TARGET) ;\
protoc --go_out=$(GO_TARGET) --twirp_out=$(GO_TARGET) \ protoc --go_out=$(GO_TARGET) --twirp_out=$(GO_TARGET) \
--go_opt=paths=source_relative \ --go_opt=paths=source_relative \
--twirp_opt=paths=source_relative \ --twirp_opt=paths=source_relative \
+7 -7
View File
@@ -18,7 +18,7 @@ import (
"github.com/livekit/livekit-server/pkg/config" "github.com/livekit/livekit-server/pkg/config"
"github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/logger"
"github.com/livekit/livekit-server/pkg/service" "github.com/livekit/livekit-server/pkg/service"
"github.com/livekit/livekit-server/proto" "github.com/livekit/livekit-server/proto/livekit"
) )
func main() { func main() {
@@ -74,8 +74,8 @@ func startServer(c *cli.Context) error {
type LivekitServer struct { type LivekitServer struct {
config *config.Config config *config.Config
roomServer proto.TwirpServer roomServer livekit.TwirpServer
rtcServer proto.TwirpServer rtcServer livekit.TwirpServer
roomHttp *http.Server roomHttp *http.Server
rtcHttp *http.Server rtcHttp *http.Server
running bool running bool
@@ -83,12 +83,12 @@ type LivekitServer struct {
} }
func NewLivekitServer(conf *config.Config, func NewLivekitServer(conf *config.Config,
roomService proto.RoomService, roomService livekit.RoomService,
rtcService *service.RTCService) (s *LivekitServer, err error) { rtcService *service.RTCService) (s *LivekitServer, err error) {
s = &LivekitServer{ s = &LivekitServer{
config: conf, config: conf,
roomServer: proto.NewRoomServiceServer(roomService), roomServer: livekit.NewRoomServiceServer(roomService),
rtcServer: proto.NewRTCServiceServer(rtcService), rtcServer: livekit.NewRTCServiceServer(rtcService),
} }
roomHandler := configureMiddlewares(conf, s.roomServer) roomHandler := configureMiddlewares(conf, s.roomServer)
@@ -98,7 +98,7 @@ func NewLivekitServer(conf *config.Config,
} }
rtcMux := http.NewServeMux() rtcMux := http.NewServeMux()
rtcMux.Handle(proto.RTCServicePathPrefix, s.rtcServer) rtcMux.Handle(livekit.RTCServicePathPrefix, s.rtcServer)
rtcMux.HandleFunc("/rtc/Signal", rtcService.Signal) rtcMux.HandleFunc("/rtc/Signal", rtcService.Signal)
rtcHandler := configureMiddlewares(conf, rtcMux) rtcHandler := configureMiddlewares(conf, rtcMux)
s.rtcHttp = &http.Server{ s.rtcHttp = &http.Server{
+3 -3
View File
@@ -6,7 +6,7 @@ import (
"github.com/pion/stun" "github.com/pion/stun"
"github.com/livekit/livekit-server/pkg/config" "github.com/livekit/livekit-server/pkg/config"
"github.com/livekit/livekit-server/proto" "github.com/livekit/livekit-server/proto/livekit"
) )
const ( const (
@@ -16,7 +16,7 @@ const (
var NodeSet = wire.NewSet(NewLocalNode) var NodeSet = wire.NewSet(NewLocalNode)
type Node struct { type Node struct {
proto.Node livekit.Node
} }
type NodeStats struct { type NodeStats struct {
@@ -33,7 +33,7 @@ func NewLocalNode(conf *config.Config) (*Node, error) {
return nil, err return nil, err
} }
n := &Node{ n := &Node{
Node: proto.Node{ Node: livekit.Node{
Id: id.String(), Id: id.String(),
RtcPort: conf.RTCPort, RtcPort: conf.RTCPort,
}, },
+33
View File
@@ -0,0 +1,33 @@
package rooms
import (
"time"
"github.com/google/uuid"
"github.com/livekit/livekit-server/proto/livekit"
)
func NewRoomForRequest(req *livekit.CreateRoomRequest) (*livekit.Room, error) {
id, err := uuid.NewRandom()
if err != nil {
return nil, err
}
return &livekit.Room{
RoomId: req.RoomId,
EmptyTimeout: req.EmptyTimeout,
MaxParticipants: req.MaxParticipants,
CreationTime: time.Now().Unix(),
Token: id.String(),
}, nil
}
func ToRoomInfo(node *livekit.Node, room *livekit.Room) *livekit.RoomInfo {
return &livekit.RoomInfo{
RoomId: room.RoomId,
NodeIp: node.Ip,
NodeRtcPort: node.RtcPort,
CreationTime: room.CreationTime,
Token: room.Token,
}
}
+7 -3
View File
@@ -4,17 +4,21 @@ import (
"context" "context"
"net/http" "net/http"
"github.com/livekit/livekit-server/proto" "github.com/livekit/livekit-server/proto/livekit"
) )
type RTCService struct { type RTCService struct {
} }
func (s *RTCService) Offer(ctx context.Context, offer *proto.SessionDescription) (answer *proto.SessionDescription, err error) { func (s *RTCService) Join(ctx context.Context, req *livekit.JoinRequest) (res *livekit.JoinResponse, err error) {
return return
} }
func (s *RTCService) Trickle(ctx context.Context, req *proto.TrickleRequest) (res *proto.TrickleResponse, err error) { func (s *RTCService) Offer(ctx context.Context, offer *livekit.SessionDescription) (answer *livekit.SessionDescription, err error) {
return
}
func (s *RTCService) Trickle(ctx context.Context, req *livekit.TrickleRequest) (res *livekit.TrickleResponse, err error) {
return return
} }
+2 -2
View File
@@ -7,7 +7,7 @@ import (
"github.com/livekit/livekit-server/pkg/config" "github.com/livekit/livekit-server/pkg/config"
"github.com/livekit/livekit-server/pkg/node" "github.com/livekit/livekit-server/pkg/node"
"github.com/livekit/livekit-server/proto" "github.com/livekit/livekit-server/proto/livekit"
) )
var ServiceSet = wire.NewSet( var ServiceSet = wire.NewSet(
@@ -15,7 +15,7 @@ var ServiceSet = wire.NewSet(
NewRTCService, NewRTCService,
) )
func NewRoomService(conf *config.Config, localNode *node.Node) (proto.RoomService, error) { func NewRoomService(conf *config.Config, localNode *node.Node) (livekit.RoomService, error) {
if conf.MultiNode { if conf.MultiNode {
return nil, fmt.Errorf("multinode is not supported") return nil, fmt.Errorf("multinode is not supported")
} else { } else {
+22 -23
View File
@@ -7,60 +7,59 @@ import (
"github.com/twitchtv/twirp" "github.com/twitchtv/twirp"
"github.com/livekit/livekit-server/pkg/node" "github.com/livekit/livekit-server/pkg/node"
"github.com/livekit/livekit-server/proto" "github.com/livekit/livekit-server/pkg/rooms"
"github.com/livekit/livekit-server/proto/livekit"
) )
// A room service that supports a single node // A rooms service that supports a single node
type SimpleRoomService struct { type SimpleRoomService struct {
localNode *node.Node localNode *node.Node
rooms map[string]bool rooms map[string]*livekit.Room
roomLock sync.Mutex roomLock sync.Mutex
} }
func NewSimpleRoomService(localNode *node.Node) (svc *SimpleRoomService, err error) { func NewSimpleRoomService(localNode *node.Node) (svc *SimpleRoomService, err error) {
svc = &SimpleRoomService{ svc = &SimpleRoomService{
localNode: localNode, localNode: localNode,
rooms: make(map[string]bool), rooms: make(map[string]*livekit.Room),
roomLock: sync.Mutex{}, roomLock: sync.Mutex{},
} }
return return
} }
func (s *SimpleRoomService) CreateRoom(ctx context.Context, req *proto.CreateRoomRequest) (res *proto.CreateRoomResponse, err error) { func (s *SimpleRoomService) CreateRoom(ctx context.Context, req *livekit.CreateRoomRequest) (res *livekit.RoomInfo, err error) {
s.roomLock.Lock() s.roomLock.Lock()
defer s.roomLock.Unlock() defer s.roomLock.Unlock()
if s.rooms[req.Room] { if s.rooms[req.RoomId] != nil {
err = twirp.NewError(twirp.AlreadyExists, "room already exists") err = twirp.NewError(twirp.AlreadyExists, "rooms already exists")
return return
} }
s.rooms[req.Room] = true room, err := rooms.NewRoomForRequest(req)
if err != nil {
res = &proto.CreateRoomResponse{ return
Room: req.Room,
NodeIp: s.localNode.Ip,
NodeRtcPort: s.localNode.RtcPort,
} }
s.rooms[req.RoomId] = room
res = rooms.ToRoomInfo(&s.localNode.Node, room)
return return
} }
func (s *SimpleRoomService) JoinRoom(ctx context.Context, req *proto.JoinRoomRequest) (res *proto.JoinRoomResponse, err error) { func (s *SimpleRoomService) GetRoom(ctx context.Context, req *livekit.GetRoomRequest) (res *livekit.RoomInfo, err error) {
if !s.rooms[req.Room] { room := s.rooms[req.RoomId]
err = twirp.NewError(twirp.AlreadyExists, "the room does not exist") if room == nil {
err = twirp.NewError(twirp.NotFound, "the rooms does not exist")
return return
} }
res = &proto.JoinRoomResponse{ res = rooms.ToRoomInfo(&s.localNode.Node, room)
NodeIp: s.localNode.Ip,
NodeRtcPort: s.localNode.RtcPort,
}
return return
} }
func (s *SimpleRoomService) DeleteRoom(ctx context.Context, req *proto.DeleteRoomRequest) (res *proto.DeleteRoomResponse, err error) { func (s *SimpleRoomService) DeleteRoom(ctx context.Context, req *livekit.DeleteRoomRequest) (res *livekit.DeleteRoomResponse, err error) {
delete(s.rooms, req.Room) delete(s.rooms, req.RoomId)
res = &proto.DeleteRoomResponse{} res = &livekit.DeleteRoomResponse{}
return return
} }
+92 -16
View File
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// source: model.proto // source: model.proto
package proto package livekit
import ( import (
fmt "fmt" fmt "fmt"
@@ -130,27 +130,103 @@ func (m *NodeStats) GetNumClients() int32 {
return 0 return 0
} }
type Room struct {
RoomId string `protobuf:"bytes,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"`
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"`
CreationTime int64 `protobuf:"varint,4,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"`
Token string `protobuf:"bytes,5,opt,name=token,proto3" json:"token,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Room) Reset() { *m = Room{} }
func (m *Room) String() string { return proto.CompactTextString(m) }
func (*Room) ProtoMessage() {}
func (*Room) Descriptor() ([]byte, []int) {
return fileDescriptor_4c16552f9fdb66d8, []int{2}
}
func (m *Room) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Room.Unmarshal(m, b)
}
func (m *Room) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Room.Marshal(b, m, deterministic)
}
func (m *Room) XXX_Merge(src proto.Message) {
xxx_messageInfo_Room.Merge(m, src)
}
func (m *Room) XXX_Size() int {
return xxx_messageInfo_Room.Size(m)
}
func (m *Room) XXX_DiscardUnknown() {
xxx_messageInfo_Room.DiscardUnknown(m)
}
var xxx_messageInfo_Room proto.InternalMessageInfo
func (m *Room) GetRoomId() string {
if m != nil {
return m.RoomId
}
return ""
}
func (m *Room) GetEmptyTimeout() uint32 {
if m != nil {
return m.EmptyTimeout
}
return 0
}
func (m *Room) GetMaxParticipants() uint32 {
if m != nil {
return m.MaxParticipants
}
return 0
}
func (m *Room) GetCreationTime() int64 {
if m != nil {
return m.CreationTime
}
return 0
}
func (m *Room) GetToken() string {
if m != nil {
return m.Token
}
return ""
}
func init() { func init() {
proto.RegisterType((*Node)(nil), "livekit.Node") proto.RegisterType((*Node)(nil), "livekit.Node")
proto.RegisterType((*NodeStats)(nil), "livekit.NodeStats") proto.RegisterType((*NodeStats)(nil), "livekit.NodeStats")
proto.RegisterType((*Room)(nil), "livekit.Room")
} }
func init() { proto.RegisterFile("model.proto", fileDescriptor_4c16552f9fdb66d8) } func init() { proto.RegisterFile("model.proto", fileDescriptor_4c16552f9fdb66d8) }
var fileDescriptor_4c16552f9fdb66d8 = []byte{ var fileDescriptor_4c16552f9fdb66d8 = []byte{
// 216 bytes of a gzipped FileDescriptorProto // 285 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x3c, 0x8f, 0x31, 0x4f, 0xc3, 0x30, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xbd, 0x4e, 0x84, 0x40,
0x10, 0x85, 0x95, 0xd0, 0xd0, 0xe6, 0x22, 0x18, 0x3c, 0x05, 0x31, 0x10, 0x75, 0x21, 0x0c, 0xa4, 0x10, 0xc7, 0x03, 0x07, 0xc7, 0x31, 0x1c, 0x6a,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 0x49, 0x4e, 0xb7, 0x1e, 0x7e, 0x2c, 0x8c, 0x3c, 0xc2, 0x95, 0x64, 0x87, 0xd6, 0x30, 0x8b, 0xa2,
0x13, 0x86, 0xb9, 0x61, 0xcb, 0x79, 0x97, 0x92, 0x1d, 0xf6, 0xff, 0xb0, 0xf3, 0x75, 0x96, 0x33,
0x14, 0x5a, 0x79, 0xa5, 0x3f, 0x77, 0x45, 0xb7, 0x27, 0xe8, 0x94, 0xe4, 0x1a, 0x62, 0xd4, 0x03,
0x57, 0x45, 0xec, 0x77, 0x59, 0xc2, 0x4b, 0xfa, 0x79, 0xfa, 0xf7, 0xd7, 0xda, 0xff, 0xff, 0xf9,
0x2f, 0x00, 0x00, 0xff, 0xff, 0x42, 0x21, 0x29, 0xdb, 0x8e, 0x01, 0x00, 0x00,
} }
+529
View File
@@ -0,0 +1,529 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: service.proto
package livekit
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type CreateRoomRequest struct {
RoomId string `protobuf:"bytes,1,opt,name=room_id,json=roomId,proto3" json:"room_id,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"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CreateRoomRequest) Reset() { *m = CreateRoomRequest{} }
func (m *CreateRoomRequest) String() string { return proto.CompactTextString(m) }
func (*CreateRoomRequest) ProtoMessage() {}
func (*CreateRoomRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_a0b84a42fa06f626, []int{0}
}
func (m *CreateRoomRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CreateRoomRequest.Unmarshal(m, b)
}
func (m *CreateRoomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CreateRoomRequest.Marshal(b, m, deterministic)
}
func (m *CreateRoomRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateRoomRequest.Merge(m, src)
}
func (m *CreateRoomRequest) XXX_Size() int {
return xxx_messageInfo_CreateRoomRequest.Size(m)
}
func (m *CreateRoomRequest) XXX_DiscardUnknown() {
xxx_messageInfo_CreateRoomRequest.DiscardUnknown(m)
}
var xxx_messageInfo_CreateRoomRequest proto.InternalMessageInfo
func (m *CreateRoomRequest) GetRoomId() string {
if m != nil {
return m.RoomId
}
return ""
}
func (m *CreateRoomRequest) GetEmptyTimeout() uint32 {
if m != nil {
return m.EmptyTimeout
}
return 0
}
func (m *CreateRoomRequest) GetMaxParticipants() uint32 {
if m != nil {
return m.MaxParticipants
}
return 0
}
type GetRoomRequest struct {
RoomId string `protobuf:"bytes,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetRoomRequest) Reset() { *m = GetRoomRequest{} }
func (m *GetRoomRequest) String() string { return proto.CompactTextString(m) }
func (*GetRoomRequest) ProtoMessage() {}
func (*GetRoomRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_a0b84a42fa06f626, []int{1}
}
func (m *GetRoomRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetRoomRequest.Unmarshal(m, b)
}
func (m *GetRoomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetRoomRequest.Marshal(b, m, deterministic)
}
func (m *GetRoomRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetRoomRequest.Merge(m, src)
}
func (m *GetRoomRequest) XXX_Size() int {
return xxx_messageInfo_GetRoomRequest.Size(m)
}
func (m *GetRoomRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GetRoomRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GetRoomRequest proto.InternalMessageInfo
func (m *GetRoomRequest) GetRoomId() string {
if m != nil {
return m.RoomId
}
return ""
}
type RoomInfo struct {
RoomId string `protobuf:"bytes,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"`
NodeIp string `protobuf:"bytes,2,opt,name=node_ip,json=nodeIp,proto3" json:"node_ip,omitempty"`
NodeRtcPort uint32 `protobuf:"varint,3,opt,name=node_rtc_port,json=nodeRtcPort,proto3" json:"node_rtc_port,omitempty"`
CreationTime int64 `protobuf:"varint,4,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"`
Token string `protobuf:"bytes,5,opt,name=token,proto3" json:"token,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *RoomInfo) Reset() { *m = RoomInfo{} }
func (m *RoomInfo) String() string { return proto.CompactTextString(m) }
func (*RoomInfo) ProtoMessage() {}
func (*RoomInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_a0b84a42fa06f626, []int{2}
}
func (m *RoomInfo) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RoomInfo.Unmarshal(m, b)
}
func (m *RoomInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_RoomInfo.Marshal(b, m, deterministic)
}
func (m *RoomInfo) XXX_Merge(src proto.Message) {
xxx_messageInfo_RoomInfo.Merge(m, src)
}
func (m *RoomInfo) XXX_Size() int {
return xxx_messageInfo_RoomInfo.Size(m)
}
func (m *RoomInfo) XXX_DiscardUnknown() {
xxx_messageInfo_RoomInfo.DiscardUnknown(m)
}
var xxx_messageInfo_RoomInfo proto.InternalMessageInfo
func (m *RoomInfo) GetRoomId() string {
if m != nil {
return m.RoomId
}
return ""
}
func (m *RoomInfo) GetNodeIp() string {
if m != nil {
return m.NodeIp
}
return ""
}
func (m *RoomInfo) GetNodeRtcPort() uint32 {
if m != nil {
return m.NodeRtcPort
}
return 0
}
func (m *RoomInfo) GetCreationTime() int64 {
if m != nil {
return m.CreationTime
}
return 0
}
func (m *RoomInfo) GetToken() string {
if m != nil {
return m.Token
}
return ""
}
type DeleteRoomRequest struct {
RoomId string `protobuf:"bytes,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DeleteRoomRequest) Reset() { *m = DeleteRoomRequest{} }
func (m *DeleteRoomRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteRoomRequest) ProtoMessage() {}
func (*DeleteRoomRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_a0b84a42fa06f626, []int{3}
}
func (m *DeleteRoomRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DeleteRoomRequest.Unmarshal(m, b)
}
func (m *DeleteRoomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DeleteRoomRequest.Marshal(b, m, deterministic)
}
func (m *DeleteRoomRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_DeleteRoomRequest.Merge(m, src)
}
func (m *DeleteRoomRequest) XXX_Size() int {
return xxx_messageInfo_DeleteRoomRequest.Size(m)
}
func (m *DeleteRoomRequest) XXX_DiscardUnknown() {
xxx_messageInfo_DeleteRoomRequest.DiscardUnknown(m)
}
var xxx_messageInfo_DeleteRoomRequest proto.InternalMessageInfo
func (m *DeleteRoomRequest) GetRoomId() string {
if m != nil {
return m.RoomId
}
return ""
}
type DeleteRoomResponse struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DeleteRoomResponse) Reset() { *m = DeleteRoomResponse{} }
func (m *DeleteRoomResponse) String() string { return proto.CompactTextString(m) }
func (*DeleteRoomResponse) ProtoMessage() {}
func (*DeleteRoomResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_a0b84a42fa06f626, []int{4}
}
func (m *DeleteRoomResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DeleteRoomResponse.Unmarshal(m, b)
}
func (m *DeleteRoomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DeleteRoomResponse.Marshal(b, m, deterministic)
}
func (m *DeleteRoomResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_DeleteRoomResponse.Merge(m, src)
}
func (m *DeleteRoomResponse) XXX_Size() int {
return xxx_messageInfo_DeleteRoomResponse.Size(m)
}
func (m *DeleteRoomResponse) XXX_DiscardUnknown() {
xxx_messageInfo_DeleteRoomResponse.DiscardUnknown(m)
}
var xxx_messageInfo_DeleteRoomResponse proto.InternalMessageInfo
type JoinRequest struct {
RoomId string `protobuf:"bytes,1,opt,name=room_id,json=roomId,proto3" json:"room_id,omitempty"`
Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
SessionId string `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
Offer *SessionDescription `protobuf:"bytes,4,opt,name=offer,proto3" json:"offer,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *JoinRequest) Reset() { *m = JoinRequest{} }
func (m *JoinRequest) String() string { return proto.CompactTextString(m) }
func (*JoinRequest) ProtoMessage() {}
func (*JoinRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_a0b84a42fa06f626, []int{5}
}
func (m *JoinRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_JoinRequest.Unmarshal(m, b)
}
func (m *JoinRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_JoinRequest.Marshal(b, m, deterministic)
}
func (m *JoinRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_JoinRequest.Merge(m, src)
}
func (m *JoinRequest) XXX_Size() int {
return xxx_messageInfo_JoinRequest.Size(m)
}
func (m *JoinRequest) XXX_DiscardUnknown() {
xxx_messageInfo_JoinRequest.DiscardUnknown(m)
}
var xxx_messageInfo_JoinRequest proto.InternalMessageInfo
func (m *JoinRequest) GetRoomId() string {
if m != nil {
return m.RoomId
}
return ""
}
func (m *JoinRequest) GetToken() string {
if m != nil {
return m.Token
}
return ""
}
func (m *JoinRequest) GetSessionId() string {
if m != nil {
return m.SessionId
}
return ""
}
func (m *JoinRequest) GetOffer() *SessionDescription {
if m != nil {
return m.Offer
}
return nil
}
type JoinResponse struct {
Answer *SessionDescription `protobuf:"bytes,1,opt,name=answer,proto3" json:"answer,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *JoinResponse) Reset() { *m = JoinResponse{} }
func (m *JoinResponse) String() string { return proto.CompactTextString(m) }
func (*JoinResponse) ProtoMessage() {}
func (*JoinResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_a0b84a42fa06f626, []int{6}
}
func (m *JoinResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_JoinResponse.Unmarshal(m, b)
}
func (m *JoinResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_JoinResponse.Marshal(b, m, deterministic)
}
func (m *JoinResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_JoinResponse.Merge(m, src)
}
func (m *JoinResponse) XXX_Size() int {
return xxx_messageInfo_JoinResponse.Size(m)
}
func (m *JoinResponse) XXX_DiscardUnknown() {
xxx_messageInfo_JoinResponse.DiscardUnknown(m)
}
var xxx_messageInfo_JoinResponse proto.InternalMessageInfo
func (m *JoinResponse) GetAnswer() *SessionDescription {
if m != nil {
return m.Answer
}
return nil
}
type TrickleRequest struct {
Candidate string `protobuf:"bytes,1,opt,name=candidate,proto3" json:"candidate,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TrickleRequest) Reset() { *m = TrickleRequest{} }
func (m *TrickleRequest) String() string { return proto.CompactTextString(m) }
func (*TrickleRequest) ProtoMessage() {}
func (*TrickleRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_a0b84a42fa06f626, []int{7}
}
func (m *TrickleRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TrickleRequest.Unmarshal(m, b)
}
func (m *TrickleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TrickleRequest.Marshal(b, m, deterministic)
}
func (m *TrickleRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_TrickleRequest.Merge(m, src)
}
func (m *TrickleRequest) XXX_Size() int {
return xxx_messageInfo_TrickleRequest.Size(m)
}
func (m *TrickleRequest) XXX_DiscardUnknown() {
xxx_messageInfo_TrickleRequest.DiscardUnknown(m)
}
var xxx_messageInfo_TrickleRequest proto.InternalMessageInfo
func (m *TrickleRequest) GetCandidate() string {
if m != nil {
return m.Candidate
}
return ""
}
type TrickleResponse struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TrickleResponse) Reset() { *m = TrickleResponse{} }
func (m *TrickleResponse) String() string { return proto.CompactTextString(m) }
func (*TrickleResponse) ProtoMessage() {}
func (*TrickleResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_a0b84a42fa06f626, []int{8}
}
func (m *TrickleResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TrickleResponse.Unmarshal(m, b)
}
func (m *TrickleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TrickleResponse.Marshal(b, m, deterministic)
}
func (m *TrickleResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_TrickleResponse.Merge(m, src)
}
func (m *TrickleResponse) XXX_Size() int {
return xxx_messageInfo_TrickleResponse.Size(m)
}
func (m *TrickleResponse) XXX_DiscardUnknown() {
xxx_messageInfo_TrickleResponse.DiscardUnknown(m)
}
var xxx_messageInfo_TrickleResponse proto.InternalMessageInfo
type SessionDescription struct {
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
Sdp []byte `protobuf:"bytes,2,opt,name=sdp,proto3" json:"sdp,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SessionDescription) Reset() { *m = SessionDescription{} }
func (m *SessionDescription) String() string { return proto.CompactTextString(m) }
func (*SessionDescription) ProtoMessage() {}
func (*SessionDescription) Descriptor() ([]byte, []int) {
return fileDescriptor_a0b84a42fa06f626, []int{9}
}
func (m *SessionDescription) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SessionDescription.Unmarshal(m, b)
}
func (m *SessionDescription) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SessionDescription.Marshal(b, m, deterministic)
}
func (m *SessionDescription) XXX_Merge(src proto.Message) {
xxx_messageInfo_SessionDescription.Merge(m, src)
}
func (m *SessionDescription) XXX_Size() int {
return xxx_messageInfo_SessionDescription.Size(m)
}
func (m *SessionDescription) XXX_DiscardUnknown() {
xxx_messageInfo_SessionDescription.DiscardUnknown(m)
}
var xxx_messageInfo_SessionDescription proto.InternalMessageInfo
func (m *SessionDescription) GetType() string {
if m != nil {
return m.Type
}
return ""
}
func (m *SessionDescription) GetSdp() []byte {
if m != nil {
return m.Sdp
}
return nil
}
func init() {
proto.RegisterType((*CreateRoomRequest)(nil), "livekit.CreateRoomRequest")
proto.RegisterType((*GetRoomRequest)(nil), "livekit.GetRoomRequest")
proto.RegisterType((*RoomInfo)(nil), "livekit.RoomInfo")
proto.RegisterType((*DeleteRoomRequest)(nil), "livekit.DeleteRoomRequest")
proto.RegisterType((*DeleteRoomResponse)(nil), "livekit.DeleteRoomResponse")
proto.RegisterType((*JoinRequest)(nil), "livekit.JoinRequest")
proto.RegisterType((*JoinResponse)(nil), "livekit.JoinResponse")
proto.RegisterType((*TrickleRequest)(nil), "livekit.TrickleRequest")
proto.RegisterType((*TrickleResponse)(nil), "livekit.TrickleResponse")
proto.RegisterType((*SessionDescription)(nil), "livekit.SessionDescription")
}
func init() { proto.RegisterFile("service.proto", fileDescriptor_a0b84a42fa06f626) }
var fileDescriptor_a0b84a42fa06f626 = []byte{
// 532 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcd, 0x6e, 0xd3, 0x4c,
0x14, 0x95, 0x9b, 0xbf, 0xcf, 0x37, 0x49, 0xdb, 0x5c, 0xe5, 0x53, 0x2c, 0x17, 0xa4, 0xc8, 0x6c,
0x52, 0x09, 0x45, 0x22, 0x11, 0x1b, 0x60, 0x03, 0x29, 0x42, 0x61, 0x43, 0x35, 0xcd, 0x8a, 0x4d,
0x64, 0xec, 0x1b, 0x69, 0x94, 0xd8, 0x63, 0x66, 0xa6, 0xa5, 0x95, 0x78, 0x06, 0x5e, 0x80, 0xb7,
0x61, 0xc5, 0x63, 0xa1, 0x19, 0x3b, 0x8e, 0x4b, 0x4a, 0xdb, 0x9d, 0xe7, 0xdc, 0x3b, 0x33, 0xe7,
0xdc, 0x73, 0x3c, 0xd0, 0x55, 0x24, 0xaf, 0x78, 0x44, 0xe3, 0x4c, 0x0a, 0x2d, 0xb0, 0xb5, 0xe1,
0x57, 0xb4, 0xe6, 0x3a, 0xf8, 0x0e, 0xbd, 0x99, 0x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, 0xe1, 0xf1, 0xff, 0xff, 0x0b, 0x2d,
0x2c, 0x7c, 0x0b, 0x8d, 0x4f, 0xc6, 0x5b, 0xbc, 0xcf, 0x3b, 0xff, 0xbe, 0x22, 0xbe, 0x81, 0x56,
0x61, 0x50, 0x65, 0x08, 0xb7, 0x2d, 0xf6, 0xbd, 0xfd, 0x42, 0x4e, 0xe0, 0x9d, 0xfb, 0x79, 0xfb,
0xf4, 0x7c, 0x69, 0xda, 0xa7, 0x68, 0xfa, 0x27, 0x00, 0x00, 0xff, 0xff, 0xa0, 0x72, 0x68, 0xb2,
0x9b, 0x04, 0x00, 0x00,
}
@@ -2,14 +2,14 @@
// source: service.proto // source: service.proto
/* /*
Package proto is a generated twirp stub package. Package livekit is a generated twirp stub package.
This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v7.1.0. This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v7.1.0.
It is generated from these files: It is generated from these files:
model.proto model.proto
service.proto service.proto
*/ */
package proto package livekit
import bytes "bytes" import bytes "bytes"
import strings "strings" import strings "strings"
@@ -44,9 +44,9 @@ const _ = twirp.TwirpPackageIsVersion7
type RoomService interface { type RoomService interface {
// TODO: how do we secure room service? // TODO: how do we secure room service?
// should be accessible to only internal servers, not external // should be accessible to only internal servers, not external
CreateRoom(context.Context, *CreateRoomRequest) (*CreateRoomResponse, error) CreateRoom(context.Context, *CreateRoomRequest) (*RoomInfo, error)
JoinRoom(context.Context, *JoinRoomRequest) (*JoinRoomResponse, error) GetRoom(context.Context, *GetRoomRequest) (*RoomInfo, error)
DeleteRoom(context.Context, *DeleteRoomRequest) (*DeleteRoomResponse, error) DeleteRoom(context.Context, *DeleteRoomRequest) (*DeleteRoomResponse, error)
} }
@@ -79,7 +79,7 @@ func NewRoomServiceProtobufClient(baseURL string, client HTTPClient, opts ...twi
serviceURL += baseServicePath(clientOpts.PathPrefix(), "livekit", "RoomService") serviceURL += baseServicePath(clientOpts.PathPrefix(), "livekit", "RoomService")
urls := [3]string{ urls := [3]string{
serviceURL + "CreateRoom", serviceURL + "CreateRoom",
serviceURL + "JoinRoom", serviceURL + "GetRoom",
serviceURL + "DeleteRoom", serviceURL + "DeleteRoom",
} }
@@ -91,13 +91,13 @@ func NewRoomServiceProtobufClient(baseURL string, client HTTPClient, opts ...twi
} }
} }
func (c *roomServiceProtobufClient) CreateRoom(ctx context.Context, in *CreateRoomRequest) (*CreateRoomResponse, error) { func (c *roomServiceProtobufClient) CreateRoom(ctx context.Context, in *CreateRoomRequest) (*RoomInfo, error) {
ctx = ctxsetters.WithPackageName(ctx, "livekit") ctx = ctxsetters.WithPackageName(ctx, "livekit")
ctx = ctxsetters.WithServiceName(ctx, "RoomService") ctx = ctxsetters.WithServiceName(ctx, "RoomService")
ctx = ctxsetters.WithMethodName(ctx, "CreateRoom") ctx = ctxsetters.WithMethodName(ctx, "CreateRoom")
caller := c.callCreateRoom caller := c.callCreateRoom
if c.interceptor != nil { if c.interceptor != nil {
caller = func(ctx context.Context, req *CreateRoomRequest) (*CreateRoomResponse, error) { caller = func(ctx context.Context, req *CreateRoomRequest) (*RoomInfo, error) {
resp, err := c.interceptor( resp, err := c.interceptor(
func(ctx context.Context, req interface{}) (interface{}, error) { func(ctx context.Context, req interface{}) (interface{}, error) {
typedReq, ok := req.(*CreateRoomRequest) typedReq, ok := req.(*CreateRoomRequest)
@@ -108,9 +108,9 @@ func (c *roomServiceProtobufClient) CreateRoom(ctx context.Context, in *CreateRo
}, },
)(ctx, req) )(ctx, req)
if resp != nil { if resp != nil {
typedResp, ok := resp.(*CreateRoomResponse) typedResp, ok := resp.(*RoomInfo)
if !ok { if !ok {
return nil, twirp.InternalError("failed type assertion resp.(*CreateRoomResponse) when calling interceptor") return nil, twirp.InternalError("failed type assertion resp.(*RoomInfo) when calling interceptor")
} }
return typedResp, err return typedResp, err
} }
@@ -120,8 +120,8 @@ func (c *roomServiceProtobufClient) CreateRoom(ctx context.Context, in *CreateRo
return caller(ctx, in) return caller(ctx, in)
} }
func (c *roomServiceProtobufClient) callCreateRoom(ctx context.Context, in *CreateRoomRequest) (*CreateRoomResponse, error) { func (c *roomServiceProtobufClient) callCreateRoom(ctx context.Context, in *CreateRoomRequest) (*RoomInfo, error) {
out := new(CreateRoomResponse) out := new(RoomInfo)
ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out) ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out)
if err != nil { if err != nil {
twerr, ok := err.(twirp.Error) twerr, ok := err.(twirp.Error)
@@ -137,26 +137,26 @@ func (c *roomServiceProtobufClient) callCreateRoom(ctx context.Context, in *Crea
return out, nil return out, nil
} }
func (c *roomServiceProtobufClient) JoinRoom(ctx context.Context, in *JoinRoomRequest) (*JoinRoomResponse, error) { func (c *roomServiceProtobufClient) GetRoom(ctx context.Context, in *GetRoomRequest) (*RoomInfo, error) {
ctx = ctxsetters.WithPackageName(ctx, "livekit") ctx = ctxsetters.WithPackageName(ctx, "livekit")
ctx = ctxsetters.WithServiceName(ctx, "RoomService") ctx = ctxsetters.WithServiceName(ctx, "RoomService")
ctx = ctxsetters.WithMethodName(ctx, "JoinRoom") ctx = ctxsetters.WithMethodName(ctx, "GetRoom")
caller := c.callJoinRoom caller := c.callGetRoom
if c.interceptor != nil { if c.interceptor != nil {
caller = func(ctx context.Context, req *JoinRoomRequest) (*JoinRoomResponse, error) { caller = func(ctx context.Context, req *GetRoomRequest) (*RoomInfo, error) {
resp, err := c.interceptor( resp, err := c.interceptor(
func(ctx context.Context, req interface{}) (interface{}, error) { func(ctx context.Context, req interface{}) (interface{}, error) {
typedReq, ok := req.(*JoinRoomRequest) typedReq, ok := req.(*GetRoomRequest)
if !ok { if !ok {
return nil, twirp.InternalError("failed type assertion req.(*JoinRoomRequest) when calling interceptor") return nil, twirp.InternalError("failed type assertion req.(*GetRoomRequest) when calling interceptor")
} }
return c.callJoinRoom(ctx, typedReq) return c.callGetRoom(ctx, typedReq)
}, },
)(ctx, req) )(ctx, req)
if resp != nil { if resp != nil {
typedResp, ok := resp.(*JoinRoomResponse) typedResp, ok := resp.(*RoomInfo)
if !ok { if !ok {
return nil, twirp.InternalError("failed type assertion resp.(*JoinRoomResponse) when calling interceptor") return nil, twirp.InternalError("failed type assertion resp.(*RoomInfo) when calling interceptor")
} }
return typedResp, err return typedResp, err
} }
@@ -166,8 +166,8 @@ func (c *roomServiceProtobufClient) JoinRoom(ctx context.Context, in *JoinRoomRe
return caller(ctx, in) return caller(ctx, in)
} }
func (c *roomServiceProtobufClient) callJoinRoom(ctx context.Context, in *JoinRoomRequest) (*JoinRoomResponse, error) { func (c *roomServiceProtobufClient) callGetRoom(ctx context.Context, in *GetRoomRequest) (*RoomInfo, error) {
out := new(JoinRoomResponse) out := new(RoomInfo)
ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[1], in, out) ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[1], in, out)
if err != nil { if err != nil {
twerr, ok := err.(twirp.Error) twerr, ok := err.(twirp.Error)
@@ -257,7 +257,7 @@ func NewRoomServiceJSONClient(baseURL string, client HTTPClient, opts ...twirp.C
serviceURL += baseServicePath(clientOpts.PathPrefix(), "livekit", "RoomService") serviceURL += baseServicePath(clientOpts.PathPrefix(), "livekit", "RoomService")
urls := [3]string{ urls := [3]string{
serviceURL + "CreateRoom", serviceURL + "CreateRoom",
serviceURL + "JoinRoom", serviceURL + "GetRoom",
serviceURL + "DeleteRoom", serviceURL + "DeleteRoom",
} }
@@ -269,13 +269,13 @@ func NewRoomServiceJSONClient(baseURL string, client HTTPClient, opts ...twirp.C
} }
} }
func (c *roomServiceJSONClient) CreateRoom(ctx context.Context, in *CreateRoomRequest) (*CreateRoomResponse, error) { func (c *roomServiceJSONClient) CreateRoom(ctx context.Context, in *CreateRoomRequest) (*RoomInfo, error) {
ctx = ctxsetters.WithPackageName(ctx, "livekit") ctx = ctxsetters.WithPackageName(ctx, "livekit")
ctx = ctxsetters.WithServiceName(ctx, "RoomService") ctx = ctxsetters.WithServiceName(ctx, "RoomService")
ctx = ctxsetters.WithMethodName(ctx, "CreateRoom") ctx = ctxsetters.WithMethodName(ctx, "CreateRoom")
caller := c.callCreateRoom caller := c.callCreateRoom
if c.interceptor != nil { if c.interceptor != nil {
caller = func(ctx context.Context, req *CreateRoomRequest) (*CreateRoomResponse, error) { caller = func(ctx context.Context, req *CreateRoomRequest) (*RoomInfo, error) {
resp, err := c.interceptor( resp, err := c.interceptor(
func(ctx context.Context, req interface{}) (interface{}, error) { func(ctx context.Context, req interface{}) (interface{}, error) {
typedReq, ok := req.(*CreateRoomRequest) typedReq, ok := req.(*CreateRoomRequest)
@@ -286,9 +286,9 @@ func (c *roomServiceJSONClient) CreateRoom(ctx context.Context, in *CreateRoomRe
}, },
)(ctx, req) )(ctx, req)
if resp != nil { if resp != nil {
typedResp, ok := resp.(*CreateRoomResponse) typedResp, ok := resp.(*RoomInfo)
if !ok { if !ok {
return nil, twirp.InternalError("failed type assertion resp.(*CreateRoomResponse) when calling interceptor") return nil, twirp.InternalError("failed type assertion resp.(*RoomInfo) when calling interceptor")
} }
return typedResp, err return typedResp, err
} }
@@ -298,8 +298,8 @@ func (c *roomServiceJSONClient) CreateRoom(ctx context.Context, in *CreateRoomRe
return caller(ctx, in) return caller(ctx, in)
} }
func (c *roomServiceJSONClient) callCreateRoom(ctx context.Context, in *CreateRoomRequest) (*CreateRoomResponse, error) { func (c *roomServiceJSONClient) callCreateRoom(ctx context.Context, in *CreateRoomRequest) (*RoomInfo, error) {
out := new(CreateRoomResponse) out := new(RoomInfo)
ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out) ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out)
if err != nil { if err != nil {
twerr, ok := err.(twirp.Error) twerr, ok := err.(twirp.Error)
@@ -315,26 +315,26 @@ func (c *roomServiceJSONClient) callCreateRoom(ctx context.Context, in *CreateRo
return out, nil return out, nil
} }
func (c *roomServiceJSONClient) JoinRoom(ctx context.Context, in *JoinRoomRequest) (*JoinRoomResponse, error) { func (c *roomServiceJSONClient) GetRoom(ctx context.Context, in *GetRoomRequest) (*RoomInfo, error) {
ctx = ctxsetters.WithPackageName(ctx, "livekit") ctx = ctxsetters.WithPackageName(ctx, "livekit")
ctx = ctxsetters.WithServiceName(ctx, "RoomService") ctx = ctxsetters.WithServiceName(ctx, "RoomService")
ctx = ctxsetters.WithMethodName(ctx, "JoinRoom") ctx = ctxsetters.WithMethodName(ctx, "GetRoom")
caller := c.callJoinRoom caller := c.callGetRoom
if c.interceptor != nil { if c.interceptor != nil {
caller = func(ctx context.Context, req *JoinRoomRequest) (*JoinRoomResponse, error) { caller = func(ctx context.Context, req *GetRoomRequest) (*RoomInfo, error) {
resp, err := c.interceptor( resp, err := c.interceptor(
func(ctx context.Context, req interface{}) (interface{}, error) { func(ctx context.Context, req interface{}) (interface{}, error) {
typedReq, ok := req.(*JoinRoomRequest) typedReq, ok := req.(*GetRoomRequest)
if !ok { if !ok {
return nil, twirp.InternalError("failed type assertion req.(*JoinRoomRequest) when calling interceptor") return nil, twirp.InternalError("failed type assertion req.(*GetRoomRequest) when calling interceptor")
} }
return c.callJoinRoom(ctx, typedReq) return c.callGetRoom(ctx, typedReq)
}, },
)(ctx, req) )(ctx, req)
if resp != nil { if resp != nil {
typedResp, ok := resp.(*JoinRoomResponse) typedResp, ok := resp.(*RoomInfo)
if !ok { if !ok {
return nil, twirp.InternalError("failed type assertion resp.(*JoinRoomResponse) when calling interceptor") return nil, twirp.InternalError("failed type assertion resp.(*RoomInfo) when calling interceptor")
} }
return typedResp, err return typedResp, err
} }
@@ -344,8 +344,8 @@ func (c *roomServiceJSONClient) JoinRoom(ctx context.Context, in *JoinRoomReques
return caller(ctx, in) return caller(ctx, in)
} }
func (c *roomServiceJSONClient) callJoinRoom(ctx context.Context, in *JoinRoomRequest) (*JoinRoomResponse, error) { func (c *roomServiceJSONClient) callGetRoom(ctx context.Context, in *GetRoomRequest) (*RoomInfo, error) {
out := new(JoinRoomResponse) out := new(RoomInfo)
ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[1], in, out) ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[1], in, out)
if err != nil { if err != nil {
twerr, ok := err.(twirp.Error) twerr, ok := err.(twirp.Error)
@@ -494,8 +494,8 @@ func (s *roomServiceServer) ServeHTTP(resp http.ResponseWriter, req *http.Reques
case "CreateRoom": case "CreateRoom":
s.serveCreateRoom(ctx, resp, req) s.serveCreateRoom(ctx, resp, req)
return return
case "JoinRoom": case "GetRoom":
s.serveJoinRoom(ctx, resp, req) s.serveGetRoom(ctx, resp, req)
return return
case "DeleteRoom": case "DeleteRoom":
s.serveDeleteRoom(ctx, resp, req) s.serveDeleteRoom(ctx, resp, req)
@@ -543,7 +543,7 @@ func (s *roomServiceServer) serveCreateRoomJSON(ctx context.Context, resp http.R
handler := s.RoomService.CreateRoom handler := s.RoomService.CreateRoom
if s.interceptor != nil { if s.interceptor != nil {
handler = func(ctx context.Context, req *CreateRoomRequest) (*CreateRoomResponse, error) { handler = func(ctx context.Context, req *CreateRoomRequest) (*RoomInfo, error) {
resp, err := s.interceptor( resp, err := s.interceptor(
func(ctx context.Context, req interface{}) (interface{}, error) { func(ctx context.Context, req interface{}) (interface{}, error) {
typedReq, ok := req.(*CreateRoomRequest) typedReq, ok := req.(*CreateRoomRequest)
@@ -554,9 +554,9 @@ func (s *roomServiceServer) serveCreateRoomJSON(ctx context.Context, resp http.R
}, },
)(ctx, req) )(ctx, req)
if resp != nil { if resp != nil {
typedResp, ok := resp.(*CreateRoomResponse) typedResp, ok := resp.(*RoomInfo)
if !ok { if !ok {
return nil, twirp.InternalError("failed type assertion resp.(*CreateRoomResponse) when calling interceptor") return nil, twirp.InternalError("failed type assertion resp.(*RoomInfo) when calling interceptor")
} }
return typedResp, err return typedResp, err
} }
@@ -565,7 +565,7 @@ func (s *roomServiceServer) serveCreateRoomJSON(ctx context.Context, resp http.R
} }
// Call service method // Call service method
var respContent *CreateRoomResponse var respContent *RoomInfo
func() { func() {
defer ensurePanicResponses(ctx, resp, s.hooks) defer ensurePanicResponses(ctx, resp, s.hooks)
respContent, err = handler(ctx, reqContent) respContent, err = handler(ctx, reqContent)
@@ -576,7 +576,7 @@ func (s *roomServiceServer) serveCreateRoomJSON(ctx context.Context, resp http.R
return return
} }
if respContent == nil { if respContent == nil {
s.writeError(ctx, resp, twirp.InternalError("received a nil *CreateRoomResponse and nil error while calling CreateRoom. nil responses are not supported")) s.writeError(ctx, resp, twirp.InternalError("received a nil *RoomInfo and nil error while calling CreateRoom. nil responses are not supported"))
return return
} }
@@ -625,7 +625,7 @@ func (s *roomServiceServer) serveCreateRoomProtobuf(ctx context.Context, resp ht
handler := s.RoomService.CreateRoom handler := s.RoomService.CreateRoom
if s.interceptor != nil { if s.interceptor != nil {
handler = func(ctx context.Context, req *CreateRoomRequest) (*CreateRoomResponse, error) { handler = func(ctx context.Context, req *CreateRoomRequest) (*RoomInfo, error) {
resp, err := s.interceptor( resp, err := s.interceptor(
func(ctx context.Context, req interface{}) (interface{}, error) { func(ctx context.Context, req interface{}) (interface{}, error) {
typedReq, ok := req.(*CreateRoomRequest) typedReq, ok := req.(*CreateRoomRequest)
@@ -636,9 +636,9 @@ func (s *roomServiceServer) serveCreateRoomProtobuf(ctx context.Context, resp ht
}, },
)(ctx, req) )(ctx, req)
if resp != nil { if resp != nil {
typedResp, ok := resp.(*CreateRoomResponse) typedResp, ok := resp.(*RoomInfo)
if !ok { if !ok {
return nil, twirp.InternalError("failed type assertion resp.(*CreateRoomResponse) when calling interceptor") return nil, twirp.InternalError("failed type assertion resp.(*RoomInfo) when calling interceptor")
} }
return typedResp, err return typedResp, err
} }
@@ -647,7 +647,7 @@ func (s *roomServiceServer) serveCreateRoomProtobuf(ctx context.Context, resp ht
} }
// Call service method // Call service method
var respContent *CreateRoomResponse var respContent *RoomInfo
func() { func() {
defer ensurePanicResponses(ctx, resp, s.hooks) defer ensurePanicResponses(ctx, resp, s.hooks)
respContent, err = handler(ctx, reqContent) respContent, err = handler(ctx, reqContent)
@@ -658,7 +658,7 @@ func (s *roomServiceServer) serveCreateRoomProtobuf(ctx context.Context, resp ht
return return
} }
if respContent == nil { if respContent == nil {
s.writeError(ctx, resp, twirp.InternalError("received a nil *CreateRoomResponse and nil error while calling CreateRoom. nil responses are not supported")) s.writeError(ctx, resp, twirp.InternalError("received a nil *RoomInfo and nil error while calling CreateRoom. nil responses are not supported"))
return return
} }
@@ -682,7 +682,7 @@ func (s *roomServiceServer) serveCreateRoomProtobuf(ctx context.Context, resp ht
callResponseSent(ctx, s.hooks) callResponseSent(ctx, s.hooks)
} }
func (s *roomServiceServer) serveJoinRoom(ctx context.Context, resp http.ResponseWriter, req *http.Request) { func (s *roomServiceServer) serveGetRoom(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
header := req.Header.Get("Content-Type") header := req.Header.Get("Content-Type")
i := strings.Index(header, ";") i := strings.Index(header, ";")
if i == -1 { if i == -1 {
@@ -690,9 +690,9 @@ func (s *roomServiceServer) serveJoinRoom(ctx context.Context, resp http.Respons
} }
switch strings.TrimSpace(strings.ToLower(header[:i])) { switch strings.TrimSpace(strings.ToLower(header[:i])) {
case "application/json": case "application/json":
s.serveJoinRoomJSON(ctx, resp, req) s.serveGetRoomJSON(ctx, resp, req)
case "application/protobuf": case "application/protobuf":
s.serveJoinRoomProtobuf(ctx, resp, req) s.serveGetRoomProtobuf(ctx, resp, req)
default: default:
msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type"))
twerr := badRouteError(msg, req.Method, req.URL.Path) twerr := badRouteError(msg, req.Method, req.URL.Path)
@@ -700,38 +700,38 @@ func (s *roomServiceServer) serveJoinRoom(ctx context.Context, resp http.Respons
} }
} }
func (s *roomServiceServer) serveJoinRoomJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { func (s *roomServiceServer) serveGetRoomJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
var err error var err error
ctx = ctxsetters.WithMethodName(ctx, "JoinRoom") ctx = ctxsetters.WithMethodName(ctx, "GetRoom")
ctx, err = callRequestRouted(ctx, s.hooks) ctx, err = callRequestRouted(ctx, s.hooks)
if err != nil { if err != nil {
s.writeError(ctx, resp, err) s.writeError(ctx, resp, err)
return return
} }
reqContent := new(JoinRoomRequest) reqContent := new(GetRoomRequest)
unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true} unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true}
if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil { if err = unmarshaler.Unmarshal(req.Body, reqContent); err != nil {
s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded")) s.writeError(ctx, resp, malformedRequestError("the json request could not be decoded"))
return return
} }
handler := s.RoomService.JoinRoom handler := s.RoomService.GetRoom
if s.interceptor != nil { if s.interceptor != nil {
handler = func(ctx context.Context, req *JoinRoomRequest) (*JoinRoomResponse, error) { handler = func(ctx context.Context, req *GetRoomRequest) (*RoomInfo, error) {
resp, err := s.interceptor( resp, err := s.interceptor(
func(ctx context.Context, req interface{}) (interface{}, error) { func(ctx context.Context, req interface{}) (interface{}, error) {
typedReq, ok := req.(*JoinRoomRequest) typedReq, ok := req.(*GetRoomRequest)
if !ok { if !ok {
return nil, twirp.InternalError("failed type assertion req.(*JoinRoomRequest) when calling interceptor") return nil, twirp.InternalError("failed type assertion req.(*GetRoomRequest) when calling interceptor")
} }
return s.RoomService.JoinRoom(ctx, typedReq) return s.RoomService.GetRoom(ctx, typedReq)
}, },
)(ctx, req) )(ctx, req)
if resp != nil { if resp != nil {
typedResp, ok := resp.(*JoinRoomResponse) typedResp, ok := resp.(*RoomInfo)
if !ok { if !ok {
return nil, twirp.InternalError("failed type assertion resp.(*JoinRoomResponse) when calling interceptor") return nil, twirp.InternalError("failed type assertion resp.(*RoomInfo) when calling interceptor")
} }
return typedResp, err return typedResp, err
} }
@@ -740,7 +740,7 @@ func (s *roomServiceServer) serveJoinRoomJSON(ctx context.Context, resp http.Res
} }
// Call service method // Call service method
var respContent *JoinRoomResponse var respContent *RoomInfo
func() { func() {
defer ensurePanicResponses(ctx, resp, s.hooks) defer ensurePanicResponses(ctx, resp, s.hooks)
respContent, err = handler(ctx, reqContent) respContent, err = handler(ctx, reqContent)
@@ -751,7 +751,7 @@ func (s *roomServiceServer) serveJoinRoomJSON(ctx context.Context, resp http.Res
return return
} }
if respContent == nil { if respContent == nil {
s.writeError(ctx, resp, twirp.InternalError("received a nil *JoinRoomResponse and nil error while calling JoinRoom. nil responses are not supported")) s.writeError(ctx, resp, twirp.InternalError("received a nil *RoomInfo and nil error while calling GetRoom. nil responses are not supported"))
return return
} }
@@ -778,9 +778,9 @@ func (s *roomServiceServer) serveJoinRoomJSON(ctx context.Context, resp http.Res
callResponseSent(ctx, s.hooks) callResponseSent(ctx, s.hooks)
} }
func (s *roomServiceServer) serveJoinRoomProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { func (s *roomServiceServer) serveGetRoomProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
var err error var err error
ctx = ctxsetters.WithMethodName(ctx, "JoinRoom") ctx = ctxsetters.WithMethodName(ctx, "GetRoom")
ctx, err = callRequestRouted(ctx, s.hooks) ctx, err = callRequestRouted(ctx, s.hooks)
if err != nil { if err != nil {
s.writeError(ctx, resp, err) s.writeError(ctx, resp, err)
@@ -792,28 +792,28 @@ func (s *roomServiceServer) serveJoinRoomProtobuf(ctx context.Context, resp http
s.writeError(ctx, resp, wrapInternal(err, "failed to read request body")) s.writeError(ctx, resp, wrapInternal(err, "failed to read request body"))
return return
} }
reqContent := new(JoinRoomRequest) reqContent := new(GetRoomRequest)
if err = proto.Unmarshal(buf, reqContent); err != nil { if err = proto.Unmarshal(buf, reqContent); err != nil {
s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
return return
} }
handler := s.RoomService.JoinRoom handler := s.RoomService.GetRoom
if s.interceptor != nil { if s.interceptor != nil {
handler = func(ctx context.Context, req *JoinRoomRequest) (*JoinRoomResponse, error) { handler = func(ctx context.Context, req *GetRoomRequest) (*RoomInfo, error) {
resp, err := s.interceptor( resp, err := s.interceptor(
func(ctx context.Context, req interface{}) (interface{}, error) { func(ctx context.Context, req interface{}) (interface{}, error) {
typedReq, ok := req.(*JoinRoomRequest) typedReq, ok := req.(*GetRoomRequest)
if !ok { if !ok {
return nil, twirp.InternalError("failed type assertion req.(*JoinRoomRequest) when calling interceptor") return nil, twirp.InternalError("failed type assertion req.(*GetRoomRequest) when calling interceptor")
} }
return s.RoomService.JoinRoom(ctx, typedReq) return s.RoomService.GetRoom(ctx, typedReq)
}, },
)(ctx, req) )(ctx, req)
if resp != nil { if resp != nil {
typedResp, ok := resp.(*JoinRoomResponse) typedResp, ok := resp.(*RoomInfo)
if !ok { if !ok {
return nil, twirp.InternalError("failed type assertion resp.(*JoinRoomResponse) when calling interceptor") return nil, twirp.InternalError("failed type assertion resp.(*RoomInfo) when calling interceptor")
} }
return typedResp, err return typedResp, err
} }
@@ -822,7 +822,7 @@ func (s *roomServiceServer) serveJoinRoomProtobuf(ctx context.Context, resp http
} }
// Call service method // Call service method
var respContent *JoinRoomResponse var respContent *RoomInfo
func() { func() {
defer ensurePanicResponses(ctx, resp, s.hooks) defer ensurePanicResponses(ctx, resp, s.hooks)
respContent, err = handler(ctx, reqContent) respContent, err = handler(ctx, reqContent)
@@ -833,7 +833,7 @@ func (s *roomServiceServer) serveJoinRoomProtobuf(ctx context.Context, resp http
return return
} }
if respContent == nil { if respContent == nil {
s.writeError(ctx, resp, twirp.InternalError("received a nil *JoinRoomResponse and nil error while calling JoinRoom. nil responses are not supported")) s.writeError(ctx, resp, twirp.InternalError("received a nil *RoomInfo and nil error while calling GetRoom. nil responses are not supported"))
return return
} }
@@ -1053,6 +1053,8 @@ func (s *roomServiceServer) PathPrefix() string {
// RTC methods performed on target node // RTC methods performed on target node
type RTCService interface { type RTCService interface {
Join(context.Context, *JoinRequest) (*JoinResponse, error)
// offer allows client to initiate a RTC session // offer allows client to initiate a RTC session
Offer(context.Context, *SessionDescription) (*SessionDescription, error) Offer(context.Context, *SessionDescription) (*SessionDescription, error)
@@ -1066,7 +1068,7 @@ type RTCService interface {
type rTCServiceProtobufClient struct { type rTCServiceProtobufClient struct {
client HTTPClient client HTTPClient
urls [2]string urls [3]string
interceptor twirp.Interceptor interceptor twirp.Interceptor
opts twirp.ClientOptions opts twirp.ClientOptions
} }
@@ -1086,7 +1088,8 @@ func NewRTCServiceProtobufClient(baseURL string, client HTTPClient, opts ...twir
// Build method URLs: <baseURL>[<prefix>]/<package>.<Service>/<Method> // Build method URLs: <baseURL>[<prefix>]/<package>.<Service>/<Method>
serviceURL := sanitizeBaseURL(baseURL) serviceURL := sanitizeBaseURL(baseURL)
serviceURL += baseServicePath(clientOpts.PathPrefix(), "livekit", "RTCService") serviceURL += baseServicePath(clientOpts.PathPrefix(), "livekit", "RTCService")
urls := [2]string{ urls := [3]string{
serviceURL + "Join",
serviceURL + "Offer", serviceURL + "Offer",
serviceURL + "Trickle", serviceURL + "Trickle",
} }
@@ -1099,6 +1102,52 @@ func NewRTCServiceProtobufClient(baseURL string, client HTTPClient, opts ...twir
} }
} }
func (c *rTCServiceProtobufClient) Join(ctx context.Context, in *JoinRequest) (*JoinResponse, error) {
ctx = ctxsetters.WithPackageName(ctx, "livekit")
ctx = ctxsetters.WithServiceName(ctx, "RTCService")
ctx = ctxsetters.WithMethodName(ctx, "Join")
caller := c.callJoin
if c.interceptor != nil {
caller = func(ctx context.Context, req *JoinRequest) (*JoinResponse, error) {
resp, err := c.interceptor(
func(ctx context.Context, req interface{}) (interface{}, error) {
typedReq, ok := req.(*JoinRequest)
if !ok {
return nil, twirp.InternalError("failed type assertion req.(*JoinRequest) when calling interceptor")
}
return c.callJoin(ctx, typedReq)
},
)(ctx, req)
if resp != nil {
typedResp, ok := resp.(*JoinResponse)
if !ok {
return nil, twirp.InternalError("failed type assertion resp.(*JoinResponse) when calling interceptor")
}
return typedResp, err
}
return nil, err
}
}
return caller(ctx, in)
}
func (c *rTCServiceProtobufClient) callJoin(ctx context.Context, in *JoinRequest) (*JoinResponse, error) {
out := new(JoinResponse)
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 *rTCServiceProtobufClient) Offer(ctx context.Context, in *SessionDescription) (*SessionDescription, error) { func (c *rTCServiceProtobufClient) Offer(ctx context.Context, in *SessionDescription) (*SessionDescription, error) {
ctx = ctxsetters.WithPackageName(ctx, "livekit") ctx = ctxsetters.WithPackageName(ctx, "livekit")
ctx = ctxsetters.WithServiceName(ctx, "RTCService") ctx = ctxsetters.WithServiceName(ctx, "RTCService")
@@ -1130,7 +1179,7 @@ func (c *rTCServiceProtobufClient) Offer(ctx context.Context, in *SessionDescrip
func (c *rTCServiceProtobufClient) callOffer(ctx context.Context, in *SessionDescription) (*SessionDescription, error) { func (c *rTCServiceProtobufClient) callOffer(ctx context.Context, in *SessionDescription) (*SessionDescription, error) {
out := new(SessionDescription) out := new(SessionDescription)
ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out) ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[1], in, out)
if err != nil { if err != nil {
twerr, ok := err.(twirp.Error) twerr, ok := err.(twirp.Error)
if !ok { if !ok {
@@ -1176,7 +1225,7 @@ func (c *rTCServiceProtobufClient) Trickle(ctx context.Context, in *TrickleReque
func (c *rTCServiceProtobufClient) callTrickle(ctx context.Context, in *TrickleRequest) (*TrickleResponse, error) { func (c *rTCServiceProtobufClient) callTrickle(ctx context.Context, in *TrickleRequest) (*TrickleResponse, error) {
out := new(TrickleResponse) out := new(TrickleResponse)
ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[1], in, out) ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[2], in, out)
if err != nil { if err != nil {
twerr, ok := err.(twirp.Error) twerr, ok := err.(twirp.Error)
if !ok { if !ok {
@@ -1197,7 +1246,7 @@ func (c *rTCServiceProtobufClient) callTrickle(ctx context.Context, in *TrickleR
type rTCServiceJSONClient struct { type rTCServiceJSONClient struct {
client HTTPClient client HTTPClient
urls [2]string urls [3]string
interceptor twirp.Interceptor interceptor twirp.Interceptor
opts twirp.ClientOptions opts twirp.ClientOptions
} }
@@ -1217,7 +1266,8 @@ func NewRTCServiceJSONClient(baseURL string, client HTTPClient, opts ...twirp.Cl
// Build method URLs: <baseURL>[<prefix>]/<package>.<Service>/<Method> // Build method URLs: <baseURL>[<prefix>]/<package>.<Service>/<Method>
serviceURL := sanitizeBaseURL(baseURL) serviceURL := sanitizeBaseURL(baseURL)
serviceURL += baseServicePath(clientOpts.PathPrefix(), "livekit", "RTCService") serviceURL += baseServicePath(clientOpts.PathPrefix(), "livekit", "RTCService")
urls := [2]string{ urls := [3]string{
serviceURL + "Join",
serviceURL + "Offer", serviceURL + "Offer",
serviceURL + "Trickle", serviceURL + "Trickle",
} }
@@ -1230,6 +1280,52 @@ func NewRTCServiceJSONClient(baseURL string, client HTTPClient, opts ...twirp.Cl
} }
} }
func (c *rTCServiceJSONClient) Join(ctx context.Context, in *JoinRequest) (*JoinResponse, error) {
ctx = ctxsetters.WithPackageName(ctx, "livekit")
ctx = ctxsetters.WithServiceName(ctx, "RTCService")
ctx = ctxsetters.WithMethodName(ctx, "Join")
caller := c.callJoin
if c.interceptor != nil {
caller = func(ctx context.Context, req *JoinRequest) (*JoinResponse, error) {
resp, err := c.interceptor(
func(ctx context.Context, req interface{}) (interface{}, error) {
typedReq, ok := req.(*JoinRequest)
if !ok {
return nil, twirp.InternalError("failed type assertion req.(*JoinRequest) when calling interceptor")
}
return c.callJoin(ctx, typedReq)
},
)(ctx, req)
if resp != nil {
typedResp, ok := resp.(*JoinResponse)
if !ok {
return nil, twirp.InternalError("failed type assertion resp.(*JoinResponse) when calling interceptor")
}
return typedResp, err
}
return nil, err
}
}
return caller(ctx, in)
}
func (c *rTCServiceJSONClient) callJoin(ctx context.Context, in *JoinRequest) (*JoinResponse, error) {
out := new(JoinResponse)
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 *rTCServiceJSONClient) Offer(ctx context.Context, in *SessionDescription) (*SessionDescription, error) { func (c *rTCServiceJSONClient) Offer(ctx context.Context, in *SessionDescription) (*SessionDescription, error) {
ctx = ctxsetters.WithPackageName(ctx, "livekit") ctx = ctxsetters.WithPackageName(ctx, "livekit")
ctx = ctxsetters.WithServiceName(ctx, "RTCService") ctx = ctxsetters.WithServiceName(ctx, "RTCService")
@@ -1261,7 +1357,7 @@ func (c *rTCServiceJSONClient) Offer(ctx context.Context, in *SessionDescription
func (c *rTCServiceJSONClient) callOffer(ctx context.Context, in *SessionDescription) (*SessionDescription, error) { func (c *rTCServiceJSONClient) callOffer(ctx context.Context, in *SessionDescription) (*SessionDescription, error) {
out := new(SessionDescription) out := new(SessionDescription)
ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out) ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[1], in, out)
if err != nil { if err != nil {
twerr, ok := err.(twirp.Error) twerr, ok := err.(twirp.Error)
if !ok { if !ok {
@@ -1307,7 +1403,7 @@ func (c *rTCServiceJSONClient) Trickle(ctx context.Context, in *TrickleRequest)
func (c *rTCServiceJSONClient) callTrickle(ctx context.Context, in *TrickleRequest) (*TrickleResponse, error) { func (c *rTCServiceJSONClient) callTrickle(ctx context.Context, in *TrickleRequest) (*TrickleResponse, error) {
out := new(TrickleResponse) out := new(TrickleResponse)
ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[1], in, out) ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[2], in, out)
if err != nil { if err != nil {
twerr, ok := err.(twirp.Error) twerr, ok := err.(twirp.Error)
if !ok { if !ok {
@@ -1406,6 +1502,9 @@ func (s *rTCServiceServer) ServeHTTP(resp http.ResponseWriter, req *http.Request
} }
switch method { switch method {
case "Join":
s.serveJoin(ctx, resp, req)
return
case "Offer": case "Offer":
s.serveOffer(ctx, resp, req) s.serveOffer(ctx, resp, req)
return return
@@ -1419,6 +1518,181 @@ func (s *rTCServiceServer) ServeHTTP(resp http.ResponseWriter, req *http.Request
} }
} }
func (s *rTCServiceServer) serveJoin(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.serveJoinJSON(ctx, resp, req)
case "application/protobuf":
s.serveJoinProtobuf(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 *rTCServiceServer) serveJoinJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
var err error
ctx = ctxsetters.WithMethodName(ctx, "Join")
ctx, err = callRequestRouted(ctx, s.hooks)
if err != nil {
s.writeError(ctx, resp, err)
return
}
reqContent := new(JoinRequest)
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.RTCService.Join
if s.interceptor != nil {
handler = func(ctx context.Context, req *JoinRequest) (*JoinResponse, error) {
resp, err := s.interceptor(
func(ctx context.Context, req interface{}) (interface{}, error) {
typedReq, ok := req.(*JoinRequest)
if !ok {
return nil, twirp.InternalError("failed type assertion req.(*JoinRequest) when calling interceptor")
}
return s.RTCService.Join(ctx, typedReq)
},
)(ctx, req)
if resp != nil {
typedResp, ok := resp.(*JoinResponse)
if !ok {
return nil, twirp.InternalError("failed type assertion resp.(*JoinResponse) when calling interceptor")
}
return typedResp, err
}
return nil, err
}
}
// Call service method
var respContent *JoinResponse
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 *JoinResponse and nil error while calling Join. 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 *rTCServiceServer) serveJoinProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
var err error
ctx = ctxsetters.WithMethodName(ctx, "Join")
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(JoinRequest)
if err = proto.Unmarshal(buf, reqContent); err != nil {
s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded"))
return
}
handler := s.RTCService.Join
if s.interceptor != nil {
handler = func(ctx context.Context, req *JoinRequest) (*JoinResponse, error) {
resp, err := s.interceptor(
func(ctx context.Context, req interface{}) (interface{}, error) {
typedReq, ok := req.(*JoinRequest)
if !ok {
return nil, twirp.InternalError("failed type assertion req.(*JoinRequest) when calling interceptor")
}
return s.RTCService.Join(ctx, typedReq)
},
)(ctx, req)
if resp != nil {
typedResp, ok := resp.(*JoinResponse)
if !ok {
return nil, twirp.InternalError("failed type assertion resp.(*JoinResponse) when calling interceptor")
}
return typedResp, err
}
return nil, err
}
}
// Call service method
var respContent *JoinResponse
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 *JoinResponse and nil error while calling Join. 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 *rTCServiceServer) serveOffer(ctx context.Context, resp http.ResponseWriter, req *http.Request) { func (s *rTCServiceServer) serveOffer(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
header := req.Header.Get("Content-Type") header := req.Header.Get("Content-Type")
i := strings.Index(header, ";") i := strings.Index(header, ";")
@@ -2331,35 +2605,39 @@ func callClientError(ctx context.Context, h *twirp.ClientHooks, err twirp.Error)
} }
var twirpFileDescriptor0 = []byte{ var twirpFileDescriptor0 = []byte{
// 475 bytes of a gzipped FileDescriptorProto // 532 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0xc1, 0x4e, 0xdb, 0x40, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcd, 0x6e, 0xd3, 0x4c,
0x10, 0xc5, 0x40, 0x31, 0x99, 0x34, 0x84, 0x8c, 0x2a, 0xe1, 0x3a, 0x3d, 0x20, 0x5f, 0x42, 0x0f, 0x14, 0x95, 0x9b, 0xbf, 0xcf, 0x37, 0x49, 0xdb, 0x5c, 0xe5, 0x53, 0x2c, 0x17, 0xa4, 0xc8, 0x6c,
0x35, 0x6a, 0xb8, 0x55, 0x95, 0xaa, 0x06, 0x90, 0xa0, 0x17, 0xaa, 0x0d, 0xa7, 0x5e, 0x22, 0xb3, 0x52, 0x09, 0x45, 0x22, 0x11, 0x1b, 0x60, 0x03, 0x29, 0x42, 0x61, 0x43, 0x35, 0xcd, 0x8a, 0x4d,
0x1e, 0xe8, 0x0a, 0xc7, 0xeb, 0xee, 0x2e, 0x48, 0x9c, 0x7b, 0xee, 0x1f, 0xf6, 0x63, 0x2a, 0xaf, 0x64, 0xec, 0x1b, 0x69, 0x94, 0xd8, 0x63, 0x66, 0xa6, 0xa5, 0x95, 0x78, 0x06, 0x5e, 0x80, 0xb7,
0xd7, 0x89, 0x5b, 0xa7, 0xe1, 0xe4, 0xf5, 0xcc, 0xdb, 0x99, 0x37, 0xf3, 0x9e, 0x16, 0x7a, 0x9a, 0x61, 0xc5, 0x63, 0xa1, 0x19, 0x3b, 0x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 0x03, 0x7c, 0xd7, 0xb6, 0xf7, 0x00, 0x3b, 0xbb, 0x2b,
0xfb, 0xae, 0x7c, 0x1d, 0x48, 0x1d, 0xdb, 0xc7, 0xe1, 0x66, 0xc7, 0x7e, 0x4e, 0xfe, 0x04, 0x00, 0x77, 0xee, 0x25, 0xc6, 0x3f, 0xb9, 0xb3, 0x96, 0x8f, 0x61, 0xf2, 0xcb, 0x01, 0x60, 0x8b, 0xd9,
0x00, 0xff, 0xff, 0x3b, 0x56, 0x68, 0x37, 0x34, 0x04, 0x00, 0x00, 0x56, 0xc9, 0x14, 0xea, 0xc6, 0x1d, 0xec, 0x97, 0x7b, 0x2a, 0xe1, 0xf1, 0xff, 0xff, 0x0b, 0x2d,
0x2c, 0x7c, 0x0b, 0x8d, 0x4f, 0xc6, 0x5b, 0xbc, 0xcf, 0x3b, 0xff, 0xbe, 0x22, 0xbe, 0x81, 0x56,
0x61, 0x50, 0x65, 0x08, 0xb7, 0x2d, 0xf6, 0xbd, 0xfd, 0x42, 0x4e, 0xe0, 0x9d, 0xfb, 0x79, 0xfb,
0xf4, 0x7c, 0x69, 0xda, 0xa7, 0x68, 0xfa, 0x27, 0x00, 0x00, 0xff, 0xff, 0xa0, 0x72, 0x68, 0xb2,
0x9b, 0x04, 0x00, 0x00,
} }
+9 -1
View File
@@ -15,4 +15,12 @@ message Node {
message NodeStats { message NodeStats {
int32 num_rooms = 1; int32 num_rooms = 1;
int32 num_clients = 2; int32 num_clients = 2;
} }
message Room {
string room_id = 1;
uint32 empty_timeout = 2;
uint32 max_participants = 3;
int64 creation_time = 4;
string token = 5;
}
-557
View File
@@ -1,557 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: service.proto
package proto
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type CreateRoomRequest struct {
Room string `protobuf:"bytes,1,opt,name=room,proto3" json:"room,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CreateRoomRequest) Reset() { *m = CreateRoomRequest{} }
func (m *CreateRoomRequest) String() string { return proto.CompactTextString(m) }
func (*CreateRoomRequest) ProtoMessage() {}
func (*CreateRoomRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_a0b84a42fa06f626, []int{0}
}
func (m *CreateRoomRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CreateRoomRequest.Unmarshal(m, b)
}
func (m *CreateRoomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CreateRoomRequest.Marshal(b, m, deterministic)
}
func (m *CreateRoomRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateRoomRequest.Merge(m, src)
}
func (m *CreateRoomRequest) XXX_Size() int {
return xxx_messageInfo_CreateRoomRequest.Size(m)
}
func (m *CreateRoomRequest) XXX_DiscardUnknown() {
xxx_messageInfo_CreateRoomRequest.DiscardUnknown(m)
}
var xxx_messageInfo_CreateRoomRequest proto.InternalMessageInfo
func (m *CreateRoomRequest) GetRoom() string {
if m != nil {
return m.Room
}
return ""
}
type CreateRoomResponse struct {
Room string `protobuf:"bytes,1,opt,name=room,proto3" json:"room,omitempty"`
NodeIp string `protobuf:"bytes,2,opt,name=node_ip,json=nodeIp,proto3" json:"node_ip,omitempty"`
NodeRtcPort uint32 `protobuf:"varint,3,opt,name=node_rtc_port,json=nodeRtcPort,proto3" json:"node_rtc_port,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CreateRoomResponse) Reset() { *m = CreateRoomResponse{} }
func (m *CreateRoomResponse) String() string { return proto.CompactTextString(m) }
func (*CreateRoomResponse) ProtoMessage() {}
func (*CreateRoomResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_a0b84a42fa06f626, []int{1}
}
func (m *CreateRoomResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CreateRoomResponse.Unmarshal(m, b)
}
func (m *CreateRoomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CreateRoomResponse.Marshal(b, m, deterministic)
}
func (m *CreateRoomResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateRoomResponse.Merge(m, src)
}
func (m *CreateRoomResponse) XXX_Size() int {
return xxx_messageInfo_CreateRoomResponse.Size(m)
}
func (m *CreateRoomResponse) XXX_DiscardUnknown() {
xxx_messageInfo_CreateRoomResponse.DiscardUnknown(m)
}
var xxx_messageInfo_CreateRoomResponse proto.InternalMessageInfo
func (m *CreateRoomResponse) GetRoom() string {
if m != nil {
return m.Room
}
return ""
}
func (m *CreateRoomResponse) GetNodeIp() string {
if m != nil {
return m.NodeIp
}
return ""
}
func (m *CreateRoomResponse) GetNodeRtcPort() uint32 {
if m != nil {
return m.NodeRtcPort
}
return 0
}
type JoinRoomRequest struct {
Room string `protobuf:"bytes,1,opt,name=room,proto3" json:"room,omitempty"`
ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *JoinRoomRequest) Reset() { *m = JoinRoomRequest{} }
func (m *JoinRoomRequest) String() string { return proto.CompactTextString(m) }
func (*JoinRoomRequest) ProtoMessage() {}
func (*JoinRoomRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_a0b84a42fa06f626, []int{2}
}
func (m *JoinRoomRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_JoinRoomRequest.Unmarshal(m, b)
}
func (m *JoinRoomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_JoinRoomRequest.Marshal(b, m, deterministic)
}
func (m *JoinRoomRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_JoinRoomRequest.Merge(m, src)
}
func (m *JoinRoomRequest) XXX_Size() int {
return xxx_messageInfo_JoinRoomRequest.Size(m)
}
func (m *JoinRoomRequest) XXX_DiscardUnknown() {
xxx_messageInfo_JoinRoomRequest.DiscardUnknown(m)
}
var xxx_messageInfo_JoinRoomRequest proto.InternalMessageInfo
func (m *JoinRoomRequest) GetRoom() string {
if m != nil {
return m.Room
}
return ""
}
func (m *JoinRoomRequest) GetClientId() string {
if m != nil {
return m.ClientId
}
return ""
}
type JoinRoomResponse struct {
NodeIp string `protobuf:"bytes,1,opt,name=node_ip,json=nodeIp,proto3" json:"node_ip,omitempty"`
NodeRtcPort uint32 `protobuf:"varint,2,opt,name=node_rtc_port,json=nodeRtcPort,proto3" json:"node_rtc_port,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *JoinRoomResponse) Reset() { *m = JoinRoomResponse{} }
func (m *JoinRoomResponse) String() string { return proto.CompactTextString(m) }
func (*JoinRoomResponse) ProtoMessage() {}
func (*JoinRoomResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_a0b84a42fa06f626, []int{3}
}
func (m *JoinRoomResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_JoinRoomResponse.Unmarshal(m, b)
}
func (m *JoinRoomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_JoinRoomResponse.Marshal(b, m, deterministic)
}
func (m *JoinRoomResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_JoinRoomResponse.Merge(m, src)
}
func (m *JoinRoomResponse) XXX_Size() int {
return xxx_messageInfo_JoinRoomResponse.Size(m)
}
func (m *JoinRoomResponse) XXX_DiscardUnknown() {
xxx_messageInfo_JoinRoomResponse.DiscardUnknown(m)
}
var xxx_messageInfo_JoinRoomResponse proto.InternalMessageInfo
func (m *JoinRoomResponse) GetNodeIp() string {
if m != nil {
return m.NodeIp
}
return ""
}
func (m *JoinRoomResponse) GetNodeRtcPort() uint32 {
if m != nil {
return m.NodeRtcPort
}
return 0
}
type DeleteRoomRequest struct {
Room string `protobuf:"bytes,1,opt,name=room,proto3" json:"room,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DeleteRoomRequest) Reset() { *m = DeleteRoomRequest{} }
func (m *DeleteRoomRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteRoomRequest) ProtoMessage() {}
func (*DeleteRoomRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_a0b84a42fa06f626, []int{4}
}
func (m *DeleteRoomRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DeleteRoomRequest.Unmarshal(m, b)
}
func (m *DeleteRoomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DeleteRoomRequest.Marshal(b, m, deterministic)
}
func (m *DeleteRoomRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_DeleteRoomRequest.Merge(m, src)
}
func (m *DeleteRoomRequest) XXX_Size() int {
return xxx_messageInfo_DeleteRoomRequest.Size(m)
}
func (m *DeleteRoomRequest) XXX_DiscardUnknown() {
xxx_messageInfo_DeleteRoomRequest.DiscardUnknown(m)
}
var xxx_messageInfo_DeleteRoomRequest proto.InternalMessageInfo
func (m *DeleteRoomRequest) GetRoom() string {
if m != nil {
return m.Room
}
return ""
}
type DeleteRoomResponse struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DeleteRoomResponse) Reset() { *m = DeleteRoomResponse{} }
func (m *DeleteRoomResponse) String() string { return proto.CompactTextString(m) }
func (*DeleteRoomResponse) ProtoMessage() {}
func (*DeleteRoomResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_a0b84a42fa06f626, []int{5}
}
func (m *DeleteRoomResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DeleteRoomResponse.Unmarshal(m, b)
}
func (m *DeleteRoomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DeleteRoomResponse.Marshal(b, m, deterministic)
}
func (m *DeleteRoomResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_DeleteRoomResponse.Merge(m, src)
}
func (m *DeleteRoomResponse) XXX_Size() int {
return xxx_messageInfo_DeleteRoomResponse.Size(m)
}
func (m *DeleteRoomResponse) XXX_DiscardUnknown() {
xxx_messageInfo_DeleteRoomResponse.DiscardUnknown(m)
}
var xxx_messageInfo_DeleteRoomResponse proto.InternalMessageInfo
type SignalRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SignalRequest) Reset() { *m = SignalRequest{} }
func (m *SignalRequest) String() string { return proto.CompactTextString(m) }
func (*SignalRequest) ProtoMessage() {}
func (*SignalRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_a0b84a42fa06f626, []int{6}
}
func (m *SignalRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SignalRequest.Unmarshal(m, b)
}
func (m *SignalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SignalRequest.Marshal(b, m, deterministic)
}
func (m *SignalRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_SignalRequest.Merge(m, src)
}
func (m *SignalRequest) XXX_Size() int {
return xxx_messageInfo_SignalRequest.Size(m)
}
func (m *SignalRequest) XXX_DiscardUnknown() {
xxx_messageInfo_SignalRequest.DiscardUnknown(m)
}
var xxx_messageInfo_SignalRequest proto.InternalMessageInfo
type SignalResponse struct {
// Types that are valid to be assigned to Payload:
// *SignalResponse_Desc
// *SignalResponse_Trickle
Payload isSignalResponse_Payload `protobuf_oneof:"payload"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SignalResponse) Reset() { *m = SignalResponse{} }
func (m *SignalResponse) String() string { return proto.CompactTextString(m) }
func (*SignalResponse) ProtoMessage() {}
func (*SignalResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_a0b84a42fa06f626, []int{7}
}
func (m *SignalResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SignalResponse.Unmarshal(m, b)
}
func (m *SignalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SignalResponse.Marshal(b, m, deterministic)
}
func (m *SignalResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_SignalResponse.Merge(m, src)
}
func (m *SignalResponse) XXX_Size() int {
return xxx_messageInfo_SignalResponse.Size(m)
}
func (m *SignalResponse) XXX_DiscardUnknown() {
xxx_messageInfo_SignalResponse.DiscardUnknown(m)
}
var xxx_messageInfo_SignalResponse proto.InternalMessageInfo
type isSignalResponse_Payload interface {
isSignalResponse_Payload()
}
type SignalResponse_Desc struct {
Desc *SessionDescription `protobuf:"bytes,1,opt,name=desc,proto3,oneof"`
}
type SignalResponse_Trickle struct {
Trickle *TrickleRequest `protobuf:"bytes,2,opt,name=trickle,proto3,oneof"`
}
func (*SignalResponse_Desc) isSignalResponse_Payload() {}
func (*SignalResponse_Trickle) isSignalResponse_Payload() {}
func (m *SignalResponse) GetPayload() isSignalResponse_Payload {
if m != nil {
return m.Payload
}
return nil
}
func (m *SignalResponse) GetDesc() *SessionDescription {
if x, ok := m.GetPayload().(*SignalResponse_Desc); ok {
return x.Desc
}
return nil
}
func (m *SignalResponse) GetTrickle() *TrickleRequest {
if x, ok := m.GetPayload().(*SignalResponse_Trickle); ok {
return x.Trickle
}
return nil
}
// XXX_OneofWrappers is for the internal use of the proto package.
func (*SignalResponse) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*SignalResponse_Desc)(nil),
(*SignalResponse_Trickle)(nil),
}
}
type TrickleRequest struct {
Candidate string `protobuf:"bytes,1,opt,name=candidate,proto3" json:"candidate,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TrickleRequest) Reset() { *m = TrickleRequest{} }
func (m *TrickleRequest) String() string { return proto.CompactTextString(m) }
func (*TrickleRequest) ProtoMessage() {}
func (*TrickleRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_a0b84a42fa06f626, []int{8}
}
func (m *TrickleRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TrickleRequest.Unmarshal(m, b)
}
func (m *TrickleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TrickleRequest.Marshal(b, m, deterministic)
}
func (m *TrickleRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_TrickleRequest.Merge(m, src)
}
func (m *TrickleRequest) XXX_Size() int {
return xxx_messageInfo_TrickleRequest.Size(m)
}
func (m *TrickleRequest) XXX_DiscardUnknown() {
xxx_messageInfo_TrickleRequest.DiscardUnknown(m)
}
var xxx_messageInfo_TrickleRequest proto.InternalMessageInfo
func (m *TrickleRequest) GetCandidate() string {
if m != nil {
return m.Candidate
}
return ""
}
type TrickleResponse struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TrickleResponse) Reset() { *m = TrickleResponse{} }
func (m *TrickleResponse) String() string { return proto.CompactTextString(m) }
func (*TrickleResponse) ProtoMessage() {}
func (*TrickleResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_a0b84a42fa06f626, []int{9}
}
func (m *TrickleResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TrickleResponse.Unmarshal(m, b)
}
func (m *TrickleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TrickleResponse.Marshal(b, m, deterministic)
}
func (m *TrickleResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_TrickleResponse.Merge(m, src)
}
func (m *TrickleResponse) XXX_Size() int {
return xxx_messageInfo_TrickleResponse.Size(m)
}
func (m *TrickleResponse) XXX_DiscardUnknown() {
xxx_messageInfo_TrickleResponse.DiscardUnknown(m)
}
var xxx_messageInfo_TrickleResponse proto.InternalMessageInfo
type SessionDescription struct {
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
Sdp []byte `protobuf:"bytes,2,opt,name=sdp,proto3" json:"sdp,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SessionDescription) Reset() { *m = SessionDescription{} }
func (m *SessionDescription) String() string { return proto.CompactTextString(m) }
func (*SessionDescription) ProtoMessage() {}
func (*SessionDescription) Descriptor() ([]byte, []int) {
return fileDescriptor_a0b84a42fa06f626, []int{10}
}
func (m *SessionDescription) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SessionDescription.Unmarshal(m, b)
}
func (m *SessionDescription) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SessionDescription.Marshal(b, m, deterministic)
}
func (m *SessionDescription) XXX_Merge(src proto.Message) {
xxx_messageInfo_SessionDescription.Merge(m, src)
}
func (m *SessionDescription) XXX_Size() int {
return xxx_messageInfo_SessionDescription.Size(m)
}
func (m *SessionDescription) XXX_DiscardUnknown() {
xxx_messageInfo_SessionDescription.DiscardUnknown(m)
}
var xxx_messageInfo_SessionDescription proto.InternalMessageInfo
func (m *SessionDescription) GetType() string {
if m != nil {
return m.Type
}
return ""
}
func (m *SessionDescription) GetSdp() []byte {
if m != nil {
return m.Sdp
}
return nil
}
func init() {
proto.RegisterType((*CreateRoomRequest)(nil), "livekit.CreateRoomRequest")
proto.RegisterType((*CreateRoomResponse)(nil), "livekit.CreateRoomResponse")
proto.RegisterType((*JoinRoomRequest)(nil), "livekit.JoinRoomRequest")
proto.RegisterType((*JoinRoomResponse)(nil), "livekit.JoinRoomResponse")
proto.RegisterType((*DeleteRoomRequest)(nil), "livekit.DeleteRoomRequest")
proto.RegisterType((*DeleteRoomResponse)(nil), "livekit.DeleteRoomResponse")
proto.RegisterType((*SignalRequest)(nil), "livekit.SignalRequest")
proto.RegisterType((*SignalResponse)(nil), "livekit.SignalResponse")
proto.RegisterType((*TrickleRequest)(nil), "livekit.TrickleRequest")
proto.RegisterType((*TrickleResponse)(nil), "livekit.TrickleResponse")
proto.RegisterType((*SessionDescription)(nil), "livekit.SessionDescription")
}
func init() { proto.RegisterFile("service.proto", fileDescriptor_a0b84a42fa06f626) }
var fileDescriptor_a0b84a42fa06f626 = []byte{
// 475 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0xc1, 0x4e, 0xdb, 0x40,
0x10, 0xc5, 0x40, 0x31, 0x99, 0x34, 0x84, 0x8c, 0x2a, 0xe1, 0x3a, 0x3d, 0x20, 0x5f, 0x42, 0x0f,
0x35, 0x6a, 0xb8, 0x55, 0x95, 0xaa, 0x06, 0x90, 0xa0, 0x17, 0xaa, 0x0d, 0xa7, 0x5e, 0x22, 0xb3,
0x1e, 0xe8, 0x0a, 0xc7, 0xeb, 0xee, 0x2e, 0x48, 0x9c, 0x7b, 0xee, 0x1f, 0xf6, 0x63, 0x2a, 0xaf,
0xd7, 0x89, 0x5b, 0xa7, 0xe1, 0xe4, 0xf5, 0xcc, 0xdb, 0x99, 0x37, 0xf3, 0x9e, 0x16, 0x7a, 0x9a,
0xd4, 0xa3, 0xe0, 0x14, 0x17, 0x4a, 0x1a, 0x89, 0x7e, 0x26, 0x1e, 0xe9, 0x5e, 0x98,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, 0x04, 0x00,
0x00, 0xff, 0xff, 0x3b, 0x56, 0x68, 0x37, 0x34, 0x04, 0x00, 0x00,
}
+24 -25
View File
@@ -8,33 +8,32 @@ option go_package = "livekit";
service RoomService { service RoomService {
// TODO: how do we secure room service? // TODO: how do we secure room service?
// should be accessible to only internal servers, not external // should be accessible to only internal servers, not external
rpc CreateRoom(CreateRoomRequest) returns (CreateRoomResponse); rpc CreateRoom(CreateRoomRequest) returns (RoomInfo);
rpc JoinRoom(JoinRoomRequest) returns (JoinRoomResponse); rpc GetRoom(GetRoomRequest) returns (RoomInfo);
rpc DeleteRoom(DeleteRoomRequest) returns (DeleteRoomResponse); rpc DeleteRoom(DeleteRoomRequest) returns (DeleteRoomResponse);
} }
message CreateRoomRequest { message CreateRoomRequest {
string room = 1; string room_id = 1;
// number of seconds the room should cleanup after being empty
uint32 empty_timeout = 2;
uint32 max_participants = 3;
} }
message CreateRoomResponse { message GetRoomRequest {
string room = 1; string room_id = 1;
}
message RoomInfo {
string room_id = 1;
string node_ip = 2; string node_ip = 2;
uint32 node_rtc_port = 3; uint32 node_rtc_port = 3;
} int64 creation_time = 4;
string token = 5;
message JoinRoomRequest {
string room = 1;
string client_id = 2;
}
message JoinRoomResponse {
string node_ip = 1;
uint32 node_rtc_port = 2;
} }
message DeleteRoomRequest { message DeleteRoomRequest {
string room = 1; string room_id = 1;
} }
message DeleteRoomResponse { message DeleteRoomResponse {
@@ -42,24 +41,24 @@ message DeleteRoomResponse {
// RTC methods performed on target node // RTC methods performed on target node
service RTCService { service RTCService {
rpc Join(JoinRequest) returns (JoinResponse);
// offer allows client to initiate a RTC session // offer allows client to initiate a RTC session
rpc Offer(SessionDescription) returns (SessionDescription); rpc Offer(SessionDescription) returns (SessionDescription);
// push channel to allow server to push commands to client
// rpc Signal(SignalRequest) returns (stream SignalResponse);
// trickle sends more ICE candidates to server // trickle sends more ICE candidates to server
rpc Trickle(TrickleRequest) returns (TrickleResponse); rpc Trickle(TrickleRequest) returns (TrickleResponse);
} }
message SignalRequest { message JoinRequest {
string room_id = 1;
string token = 2;
string session_id = 3;
SessionDescription offer = 4;
} }
message SignalResponse { message JoinResponse {
oneof payload { SessionDescription answer = 1;
SessionDescription desc = 1;
TrickleRequest trickle = 2;
}
} }
message TrickleRequest { message TrickleRequest {