refactor - moved common code to livekit/protocol
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
# 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/
|
||||
|
||||
+12
-7
@@ -1,12 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd /tmp
|
||||
git clone https://github.com/magefile/mage
|
||||
cd mage
|
||||
go run bootstrap.go
|
||||
rm -rf /tmp/mage
|
||||
|
||||
if ! command -v mage &> /dev/null
|
||||
then
|
||||
echo "Ensure ${GOPATH}/bin is in your \$PATH"
|
||||
pushd /tmp
|
||||
git clone https://github.com/magefile/mage
|
||||
cd mage
|
||||
go run bootstrap.go
|
||||
rm -rf /tmp/mage
|
||||
popd
|
||||
fi
|
||||
|
||||
if ! command -v mage &> /dev/null
|
||||
then
|
||||
echo "Ensure `go env GOPATH`/bin is in your \$PATH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -21,8 +21,8 @@ import (
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/logger"
|
||||
"github.com/livekit/livekit-server/pkg/rtc"
|
||||
"github.com/livekit/livekit-server/pkg/utils"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
"github.com/livekit/protocol/utils"
|
||||
)
|
||||
|
||||
type RTCClient struct {
|
||||
|
||||
@@ -9,9 +9,9 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
|
||||
"github.com/livekit/livekit-server/cmd/cli/client"
|
||||
"github.com/livekit/livekit-server/pkg/auth"
|
||||
"github.com/livekit/livekit-server/pkg/logger"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
"github.com/livekit/protocol/auth"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
|
||||
"github.com/livekit/livekit-server/cmd/cli/client"
|
||||
"github.com/livekit/livekit-server/pkg/auth"
|
||||
"github.com/livekit/livekit-server/pkg/logger"
|
||||
"github.com/livekit/protocol/auth"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/auth"
|
||||
"github.com/livekit/protocol/auth"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/auth"
|
||||
"github.com/livekit/protocol/auth"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
+2
-2
@@ -17,13 +17,13 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
"github.com/urfave/cli/v2"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/auth"
|
||||
"github.com/livekit/livekit-server/pkg/config"
|
||||
"github.com/livekit/livekit-server/pkg/logger"
|
||||
"github.com/livekit/livekit-server/pkg/routing"
|
||||
"github.com/livekit/livekit-server/pkg/service"
|
||||
"github.com/livekit/livekit-server/pkg/utils"
|
||||
"github.com/livekit/livekit-server/version"
|
||||
"github.com/livekit/protocol/auth"
|
||||
"github.com/livekit/protocol/utils"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -8,8 +8,8 @@ require (
|
||||
github.com/golang/protobuf v1.4.3
|
||||
github.com/google/wire v0.4.0
|
||||
github.com/gorilla/websocket v1.4.2
|
||||
github.com/karlseguin/ccache/v2 v2.0.7
|
||||
github.com/lithammer/shortuuid/v3 v3.0.4
|
||||
github.com/lithammer/shortuuid/v3 v3.0.6
|
||||
github.com/livekit/protocol v0.1.0
|
||||
github.com/lytics/base62 v0.0.0-20180808010106-0ee4de5a5d6d
|
||||
github.com/magefile/mage v1.11.0
|
||||
github.com/maxbrunsfeld/counterfeiter/v6 v6.3.0
|
||||
@@ -31,6 +31,5 @@ require (
|
||||
golang.org/x/mod v0.4.0 // indirect
|
||||
golang.org/x/tools v0.0.0-20201222163215-f2e330f49058 // indirect
|
||||
google.golang.org/protobuf v1.25.0
|
||||
gopkg.in/square/go-jose.v2 v2.5.1
|
||||
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776
|
||||
)
|
||||
|
||||
@@ -140,8 +140,9 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
|
||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
@@ -149,7 +150,6 @@ github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OI
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
|
||||
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.5/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs=
|
||||
@@ -210,10 +210,6 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1
|
||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
|
||||
github.com/karlseguin/ccache/v2 v2.0.7 h1:y5Pfi4eiyYCOD6LS/Kj+o6Nb4M5Ngpw9qFQs+v44ZYM=
|
||||
github.com/karlseguin/ccache/v2 v2.0.7/go.mod h1:2BDThcfQMf/c0jnZowt16eW405XIqZPavt+HoYEtcxQ=
|
||||
github.com/karlseguin/expect v1.0.2-0.20190806010014-778a5f0c6003 h1:vJ0Snvo+SLMY72r5J4sEfkuE7AFbixEP2qRbEcum/wA=
|
||||
github.com/karlseguin/expect v1.0.2-0.20190806010014-778a5f0c6003/go.mod h1:zNBxMY8P21owkeogJELCLeHIt+voOSduHYTFUbwRAV8=
|
||||
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
@@ -225,8 +221,10 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM=
|
||||
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
|
||||
github.com/lithammer/shortuuid/v3 v3.0.4 h1:uj4xhotfY92Y1Oa6n6HUiFn87CdoEHYUlTy0+IgbLrs=
|
||||
github.com/lithammer/shortuuid/v3 v3.0.4/go.mod h1:RviRjexKqIzx/7r1peoAITm6m7gnif/h+0zmolKJjzw=
|
||||
github.com/lithammer/shortuuid/v3 v3.0.6 h1:pr15YQyvhiSX/qPxncFtqk+v4xLEpOZObbsY/mKrcvA=
|
||||
github.com/lithammer/shortuuid/v3 v3.0.6/go.mod h1:vMk8ke37EmiewwolSO1NLW8vP4ZaKlRuDIi8tWWmAts=
|
||||
github.com/livekit/protocol v0.1.0 h1:BBJFcnuXI0Q2yrLC40U92f7lIrjUEVriewmlNzPSfcM=
|
||||
github.com/livekit/protocol v0.1.0/go.mod h1:dB4MovJpCr9muBQAJUOhzgVqsrkHKf3/C0O6v/M08+I=
|
||||
github.com/lucsky/cuid v1.0.2 h1:z4XlExeoderxoPj2/dxKOyPxe9RCOu7yNq9/XWxIUMQ=
|
||||
github.com/lucsky/cuid v1.0.2/go.mod h1:QaaJqckboimOmhRSJXSx/+IT+VTfxfPGSo/6mfgUfmE=
|
||||
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
|
||||
@@ -447,8 +445,6 @@ github.com/urfave/cli/v2 v2.2.0 h1:JTTnM6wKzdA0Jqodd966MVj4vWbbquZykeX1sKbe2C4=
|
||||
github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ=
|
||||
github.com/urfave/negroni v1.0.0 h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc=
|
||||
github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4=
|
||||
github.com/wsxiaoys/terminal v0.0.0-20160513160801-0940f3fc43a0 h1:3UeQBvD0TFrlVjOeLOBz+CPAI8dnbqNSVwUwRrkp7vQ=
|
||||
github.com/wsxiaoys/terminal v0.0.0-20160513160801-0940f3fc43a0/go.mod h1:IXCdmsXIht47RaVFLEdVnh1t+pgYtTAhQGj73kz+2DM=
|
||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
@@ -485,8 +481,9 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY=
|
||||
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
|
||||
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g=
|
||||
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
|
||||
+12
-12
@@ -43,11 +43,11 @@ func Deps() error {
|
||||
|
||||
// regenerate protobuf
|
||||
func Proto() error {
|
||||
updated, err := target.Path("proto/livekit/model.pb.go",
|
||||
"proto/model.proto",
|
||||
"proto/room.proto",
|
||||
"proto/rtc.proto",
|
||||
"proto/internal.proto",
|
||||
updated, err := target.Path("proto/model.pb.go",
|
||||
"../protocol/model.proto",
|
||||
"../protocol/room.proto",
|
||||
"../protocol/rtc.proto",
|
||||
"../protocol/internal.proto",
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -57,7 +57,7 @@ func Proto() error {
|
||||
}
|
||||
|
||||
fmt.Println("generating protobuf")
|
||||
target := "proto/livekit"
|
||||
target := "proto"
|
||||
if err := os.MkdirAll(target, 0755); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -83,8 +83,8 @@ func Proto() error {
|
||||
"--twirp_opt=paths=source_relative",
|
||||
"--plugin=go="+protoc_go_path,
|
||||
"--plugin=twirp="+twirp_path,
|
||||
"-I=proto",
|
||||
"proto/room.proto",
|
||||
"-I=../protocol",
|
||||
"../protocol/room.proto",
|
||||
)
|
||||
connectStd(cmd)
|
||||
if err := cmd.Run(); err != nil {
|
||||
@@ -96,10 +96,10 @@ func Proto() error {
|
||||
"--go_out", target,
|
||||
"--go_opt=paths=source_relative",
|
||||
"--plugin=go="+protoc_go_path,
|
||||
"-I=proto",
|
||||
"proto/rtc.proto",
|
||||
"proto/internal.proto",
|
||||
"proto/model.proto",
|
||||
"-I=../protocol",
|
||||
"../protocol/rtc.proto",
|
||||
"../protocol/internal.proto",
|
||||
"../protocol/model.proto",
|
||||
)
|
||||
connectStd(cmd)
|
||||
if err := cmd.Run(); err != nil {
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gopkg.in/square/go-jose.v2"
|
||||
"gopkg.in/square/go-jose.v2/jwt"
|
||||
)
|
||||
|
||||
const (
|
||||
defaultValidDuration = 6 * time.Hour
|
||||
)
|
||||
|
||||
// Signer that produces token signed with API key and secret
|
||||
type AccessToken struct {
|
||||
apiKey string
|
||||
secret string
|
||||
identity string
|
||||
videoGrant *VideoGrant
|
||||
metadata map[string]interface{}
|
||||
validFor time.Duration
|
||||
}
|
||||
|
||||
func NewAccessToken(key string, secret string) *AccessToken {
|
||||
return &AccessToken{
|
||||
apiKey: key,
|
||||
secret: secret,
|
||||
}
|
||||
}
|
||||
|
||||
func (t *AccessToken) SetIdentity(identity string) *AccessToken {
|
||||
t.identity = identity
|
||||
return t
|
||||
}
|
||||
|
||||
func (t *AccessToken) SetValidFor(duration time.Duration) *AccessToken {
|
||||
t.validFor = duration
|
||||
return t
|
||||
}
|
||||
|
||||
func (t *AccessToken) AddGrant(grant *VideoGrant) *AccessToken {
|
||||
t.videoGrant = grant
|
||||
return t
|
||||
}
|
||||
|
||||
func (t *AccessToken) SetMetadata(md map[string]interface{}) *AccessToken {
|
||||
t.metadata = md
|
||||
return t
|
||||
}
|
||||
|
||||
func (t *AccessToken) ToJWT() (string, error) {
|
||||
if t.apiKey == "" || t.secret == "" {
|
||||
return "", ErrKeysMissing
|
||||
}
|
||||
|
||||
sig, err := jose.NewSigner(jose.SigningKey{Algorithm: jose.HS256, Key: []byte(t.secret)},
|
||||
(&jose.SignerOptions{}).WithType("JWT"))
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
validFor := defaultValidDuration
|
||||
if t.validFor > 0 {
|
||||
validFor = t.validFor
|
||||
}
|
||||
|
||||
cl := jwt.Claims{
|
||||
Issuer: t.apiKey,
|
||||
NotBefore: jwt.NewNumericDate(time.Now()),
|
||||
Expiry: jwt.NewNumericDate(time.Now().Add(validFor)),
|
||||
ID: t.identity,
|
||||
}
|
||||
grants := &ClaimGrants{}
|
||||
if t.videoGrant != nil {
|
||||
grants.Video = t.videoGrant
|
||||
}
|
||||
if t.metadata != nil {
|
||||
grants.Metadata = t.metadata
|
||||
}
|
||||
return jwt.Signed(sig).Claims(cl).Claims(grants).CompactSerialize()
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
package auth_test
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"gopkg.in/square/go-jose.v2/jwt"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/auth"
|
||||
"github.com/livekit/livekit-server/pkg/utils"
|
||||
)
|
||||
|
||||
func TestAccessToken(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
t.Run("keys must be set", func(t *testing.T) {
|
||||
token := auth.NewAccessToken("", "")
|
||||
_, err := token.ToJWT()
|
||||
assert.Equal(t, auth.ErrKeysMissing, err)
|
||||
})
|
||||
|
||||
t.Run("generates a decodeable key", func(t *testing.T) {
|
||||
apiKey, secret := apiKeypair()
|
||||
videoGrant := &auth.VideoGrant{RoomJoin: true, Room: "myroom"}
|
||||
at := auth.NewAccessToken(apiKey, secret).
|
||||
AddGrant(videoGrant).
|
||||
SetValidFor(time.Minute * 5).
|
||||
SetIdentity("user")
|
||||
value, err := at.ToJWT()
|
||||
//fmt.Println(raw)
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.Len(t, strings.Split(value, "."), 3)
|
||||
|
||||
// ensure it's a valid JWT
|
||||
token, err := jwt.ParseSigned(value)
|
||||
assert.NoError(t, err)
|
||||
|
||||
decodedGrant := auth.ClaimGrants{}
|
||||
err = token.UnsafeClaimsWithoutVerification(&decodedGrant)
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.EqualValues(t, videoGrant, decodedGrant.Video)
|
||||
})
|
||||
|
||||
t.Run("default validity should be more than a minute", func(t *testing.T) {
|
||||
apiKey, secret := apiKeypair()
|
||||
videoGrant := &auth.VideoGrant{RoomJoin: true, Room: "myroom"}
|
||||
at := auth.NewAccessToken(apiKey, secret).
|
||||
AddGrant(videoGrant)
|
||||
value, err := at.ToJWT()
|
||||
token, err := jwt.ParseSigned(value)
|
||||
|
||||
claim := jwt.Claims{}
|
||||
decodedGrant := auth.ClaimGrants{}
|
||||
err = token.UnsafeClaimsWithoutVerification(&claim, &decodedGrant)
|
||||
assert.NoError(t, err)
|
||||
assert.EqualValues(t, videoGrant, decodedGrant.Video)
|
||||
|
||||
// default validity
|
||||
assert.True(t, claim.Expiry.Time().Sub(claim.IssuedAt.Time()) > time.Minute)
|
||||
})
|
||||
}
|
||||
|
||||
func apiKeypair() (string, string) {
|
||||
return utils.NewGuid(utils.APIKeyPrefix), utils.RandomSecret()
|
||||
}
|
||||
@@ -1,176 +0,0 @@
|
||||
// Code generated by counterfeiter. DO NOT EDIT.
|
||||
package authfakes
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/auth"
|
||||
)
|
||||
|
||||
type FakeKeyProvider struct {
|
||||
GetSecretStub func(string) string
|
||||
getSecretMutex sync.RWMutex
|
||||
getSecretArgsForCall []struct {
|
||||
arg1 string
|
||||
}
|
||||
getSecretReturns struct {
|
||||
result1 string
|
||||
}
|
||||
getSecretReturnsOnCall map[int]struct {
|
||||
result1 string
|
||||
}
|
||||
NumKeysStub func() int
|
||||
numKeysMutex sync.RWMutex
|
||||
numKeysArgsForCall []struct {
|
||||
}
|
||||
numKeysReturns struct {
|
||||
result1 int
|
||||
}
|
||||
numKeysReturnsOnCall map[int]struct {
|
||||
result1 int
|
||||
}
|
||||
invocations map[string][][]interface{}
|
||||
invocationsMutex sync.RWMutex
|
||||
}
|
||||
|
||||
func (fake *FakeKeyProvider) GetSecret(arg1 string) string {
|
||||
fake.getSecretMutex.Lock()
|
||||
ret, specificReturn := fake.getSecretReturnsOnCall[len(fake.getSecretArgsForCall)]
|
||||
fake.getSecretArgsForCall = append(fake.getSecretArgsForCall, struct {
|
||||
arg1 string
|
||||
}{arg1})
|
||||
stub := fake.GetSecretStub
|
||||
fakeReturns := fake.getSecretReturns
|
||||
fake.recordInvocation("GetSecret", []interface{}{arg1})
|
||||
fake.getSecretMutex.Unlock()
|
||||
if stub != nil {
|
||||
return stub(arg1)
|
||||
}
|
||||
if specificReturn {
|
||||
return ret.result1
|
||||
}
|
||||
return fakeReturns.result1
|
||||
}
|
||||
|
||||
func (fake *FakeKeyProvider) GetSecretCallCount() int {
|
||||
fake.getSecretMutex.RLock()
|
||||
defer fake.getSecretMutex.RUnlock()
|
||||
return len(fake.getSecretArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeKeyProvider) GetSecretCalls(stub func(string) string) {
|
||||
fake.getSecretMutex.Lock()
|
||||
defer fake.getSecretMutex.Unlock()
|
||||
fake.GetSecretStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeKeyProvider) GetSecretArgsForCall(i int) string {
|
||||
fake.getSecretMutex.RLock()
|
||||
defer fake.getSecretMutex.RUnlock()
|
||||
argsForCall := fake.getSecretArgsForCall[i]
|
||||
return argsForCall.arg1
|
||||
}
|
||||
|
||||
func (fake *FakeKeyProvider) GetSecretReturns(result1 string) {
|
||||
fake.getSecretMutex.Lock()
|
||||
defer fake.getSecretMutex.Unlock()
|
||||
fake.GetSecretStub = nil
|
||||
fake.getSecretReturns = struct {
|
||||
result1 string
|
||||
}{result1}
|
||||
}
|
||||
|
||||
func (fake *FakeKeyProvider) GetSecretReturnsOnCall(i int, result1 string) {
|
||||
fake.getSecretMutex.Lock()
|
||||
defer fake.getSecretMutex.Unlock()
|
||||
fake.GetSecretStub = nil
|
||||
if fake.getSecretReturnsOnCall == nil {
|
||||
fake.getSecretReturnsOnCall = make(map[int]struct {
|
||||
result1 string
|
||||
})
|
||||
}
|
||||
fake.getSecretReturnsOnCall[i] = struct {
|
||||
result1 string
|
||||
}{result1}
|
||||
}
|
||||
|
||||
func (fake *FakeKeyProvider) NumKeys() int {
|
||||
fake.numKeysMutex.Lock()
|
||||
ret, specificReturn := fake.numKeysReturnsOnCall[len(fake.numKeysArgsForCall)]
|
||||
fake.numKeysArgsForCall = append(fake.numKeysArgsForCall, struct {
|
||||
}{})
|
||||
stub := fake.NumKeysStub
|
||||
fakeReturns := fake.numKeysReturns
|
||||
fake.recordInvocation("NumKeys", []interface{}{})
|
||||
fake.numKeysMutex.Unlock()
|
||||
if stub != nil {
|
||||
return stub()
|
||||
}
|
||||
if specificReturn {
|
||||
return ret.result1
|
||||
}
|
||||
return fakeReturns.result1
|
||||
}
|
||||
|
||||
func (fake *FakeKeyProvider) NumKeysCallCount() int {
|
||||
fake.numKeysMutex.RLock()
|
||||
defer fake.numKeysMutex.RUnlock()
|
||||
return len(fake.numKeysArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeKeyProvider) NumKeysCalls(stub func() int) {
|
||||
fake.numKeysMutex.Lock()
|
||||
defer fake.numKeysMutex.Unlock()
|
||||
fake.NumKeysStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeKeyProvider) NumKeysReturns(result1 int) {
|
||||
fake.numKeysMutex.Lock()
|
||||
defer fake.numKeysMutex.Unlock()
|
||||
fake.NumKeysStub = nil
|
||||
fake.numKeysReturns = struct {
|
||||
result1 int
|
||||
}{result1}
|
||||
}
|
||||
|
||||
func (fake *FakeKeyProvider) NumKeysReturnsOnCall(i int, result1 int) {
|
||||
fake.numKeysMutex.Lock()
|
||||
defer fake.numKeysMutex.Unlock()
|
||||
fake.NumKeysStub = nil
|
||||
if fake.numKeysReturnsOnCall == nil {
|
||||
fake.numKeysReturnsOnCall = make(map[int]struct {
|
||||
result1 int
|
||||
})
|
||||
}
|
||||
fake.numKeysReturnsOnCall[i] = struct {
|
||||
result1 int
|
||||
}{result1}
|
||||
}
|
||||
|
||||
func (fake *FakeKeyProvider) Invocations() map[string][][]interface{} {
|
||||
fake.invocationsMutex.RLock()
|
||||
defer fake.invocationsMutex.RUnlock()
|
||||
fake.getSecretMutex.RLock()
|
||||
defer fake.getSecretMutex.RUnlock()
|
||||
fake.numKeysMutex.RLock()
|
||||
defer fake.numKeysMutex.RUnlock()
|
||||
copiedInvocations := map[string][][]interface{}{}
|
||||
for key, value := range fake.invocations {
|
||||
copiedInvocations[key] = value
|
||||
}
|
||||
return copiedInvocations
|
||||
}
|
||||
|
||||
func (fake *FakeKeyProvider) recordInvocation(key string, args []interface{}) {
|
||||
fake.invocationsMutex.Lock()
|
||||
defer fake.invocationsMutex.Unlock()
|
||||
if fake.invocations == nil {
|
||||
fake.invocations = map[string][][]interface{}{}
|
||||
}
|
||||
if fake.invocations[key] == nil {
|
||||
fake.invocations[key] = [][]interface{}{}
|
||||
}
|
||||
fake.invocations[key] = append(fake.invocations[key], args)
|
||||
}
|
||||
|
||||
var _ auth.KeyProvider = new(FakeKeyProvider)
|
||||
@@ -1,181 +0,0 @@
|
||||
// Code generated by counterfeiter. DO NOT EDIT.
|
||||
package authfakes
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/auth"
|
||||
)
|
||||
|
||||
type FakeTokenVerifier struct {
|
||||
IdentityStub func() string
|
||||
identityMutex sync.RWMutex
|
||||
identityArgsForCall []struct {
|
||||
}
|
||||
identityReturns struct {
|
||||
result1 string
|
||||
}
|
||||
identityReturnsOnCall map[int]struct {
|
||||
result1 string
|
||||
}
|
||||
VerifyStub func(interface{}) (*auth.ClaimGrants, error)
|
||||
verifyMutex sync.RWMutex
|
||||
verifyArgsForCall []struct {
|
||||
arg1 interface{}
|
||||
}
|
||||
verifyReturns struct {
|
||||
result1 *auth.ClaimGrants
|
||||
result2 error
|
||||
}
|
||||
verifyReturnsOnCall map[int]struct {
|
||||
result1 *auth.ClaimGrants
|
||||
result2 error
|
||||
}
|
||||
invocations map[string][][]interface{}
|
||||
invocationsMutex sync.RWMutex
|
||||
}
|
||||
|
||||
func (fake *FakeTokenVerifier) Identity() string {
|
||||
fake.identityMutex.Lock()
|
||||
ret, specificReturn := fake.identityReturnsOnCall[len(fake.identityArgsForCall)]
|
||||
fake.identityArgsForCall = append(fake.identityArgsForCall, struct {
|
||||
}{})
|
||||
stub := fake.IdentityStub
|
||||
fakeReturns := fake.identityReturns
|
||||
fake.recordInvocation("Identity", []interface{}{})
|
||||
fake.identityMutex.Unlock()
|
||||
if stub != nil {
|
||||
return stub()
|
||||
}
|
||||
if specificReturn {
|
||||
return ret.result1
|
||||
}
|
||||
return fakeReturns.result1
|
||||
}
|
||||
|
||||
func (fake *FakeTokenVerifier) IdentityCallCount() int {
|
||||
fake.identityMutex.RLock()
|
||||
defer fake.identityMutex.RUnlock()
|
||||
return len(fake.identityArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeTokenVerifier) IdentityCalls(stub func() string) {
|
||||
fake.identityMutex.Lock()
|
||||
defer fake.identityMutex.Unlock()
|
||||
fake.IdentityStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeTokenVerifier) IdentityReturns(result1 string) {
|
||||
fake.identityMutex.Lock()
|
||||
defer fake.identityMutex.Unlock()
|
||||
fake.IdentityStub = nil
|
||||
fake.identityReturns = struct {
|
||||
result1 string
|
||||
}{result1}
|
||||
}
|
||||
|
||||
func (fake *FakeTokenVerifier) IdentityReturnsOnCall(i int, result1 string) {
|
||||
fake.identityMutex.Lock()
|
||||
defer fake.identityMutex.Unlock()
|
||||
fake.IdentityStub = nil
|
||||
if fake.identityReturnsOnCall == nil {
|
||||
fake.identityReturnsOnCall = make(map[int]struct {
|
||||
result1 string
|
||||
})
|
||||
}
|
||||
fake.identityReturnsOnCall[i] = struct {
|
||||
result1 string
|
||||
}{result1}
|
||||
}
|
||||
|
||||
func (fake *FakeTokenVerifier) Verify(arg1 interface{}) (*auth.ClaimGrants, error) {
|
||||
fake.verifyMutex.Lock()
|
||||
ret, specificReturn := fake.verifyReturnsOnCall[len(fake.verifyArgsForCall)]
|
||||
fake.verifyArgsForCall = append(fake.verifyArgsForCall, struct {
|
||||
arg1 interface{}
|
||||
}{arg1})
|
||||
stub := fake.VerifyStub
|
||||
fakeReturns := fake.verifyReturns
|
||||
fake.recordInvocation("Verify", []interface{}{arg1})
|
||||
fake.verifyMutex.Unlock()
|
||||
if stub != nil {
|
||||
return stub(arg1)
|
||||
}
|
||||
if specificReturn {
|
||||
return ret.result1, ret.result2
|
||||
}
|
||||
return fakeReturns.result1, fakeReturns.result2
|
||||
}
|
||||
|
||||
func (fake *FakeTokenVerifier) VerifyCallCount() int {
|
||||
fake.verifyMutex.RLock()
|
||||
defer fake.verifyMutex.RUnlock()
|
||||
return len(fake.verifyArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeTokenVerifier) VerifyCalls(stub func(interface{}) (*auth.ClaimGrants, error)) {
|
||||
fake.verifyMutex.Lock()
|
||||
defer fake.verifyMutex.Unlock()
|
||||
fake.VerifyStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeTokenVerifier) VerifyArgsForCall(i int) interface{} {
|
||||
fake.verifyMutex.RLock()
|
||||
defer fake.verifyMutex.RUnlock()
|
||||
argsForCall := fake.verifyArgsForCall[i]
|
||||
return argsForCall.arg1
|
||||
}
|
||||
|
||||
func (fake *FakeTokenVerifier) VerifyReturns(result1 *auth.ClaimGrants, result2 error) {
|
||||
fake.verifyMutex.Lock()
|
||||
defer fake.verifyMutex.Unlock()
|
||||
fake.VerifyStub = nil
|
||||
fake.verifyReturns = struct {
|
||||
result1 *auth.ClaimGrants
|
||||
result2 error
|
||||
}{result1, result2}
|
||||
}
|
||||
|
||||
func (fake *FakeTokenVerifier) VerifyReturnsOnCall(i int, result1 *auth.ClaimGrants, result2 error) {
|
||||
fake.verifyMutex.Lock()
|
||||
defer fake.verifyMutex.Unlock()
|
||||
fake.VerifyStub = nil
|
||||
if fake.verifyReturnsOnCall == nil {
|
||||
fake.verifyReturnsOnCall = make(map[int]struct {
|
||||
result1 *auth.ClaimGrants
|
||||
result2 error
|
||||
})
|
||||
}
|
||||
fake.verifyReturnsOnCall[i] = struct {
|
||||
result1 *auth.ClaimGrants
|
||||
result2 error
|
||||
}{result1, result2}
|
||||
}
|
||||
|
||||
func (fake *FakeTokenVerifier) Invocations() map[string][][]interface{} {
|
||||
fake.invocationsMutex.RLock()
|
||||
defer fake.invocationsMutex.RUnlock()
|
||||
fake.identityMutex.RLock()
|
||||
defer fake.identityMutex.RUnlock()
|
||||
fake.verifyMutex.RLock()
|
||||
defer fake.verifyMutex.RUnlock()
|
||||
copiedInvocations := map[string][][]interface{}{}
|
||||
for key, value := range fake.invocations {
|
||||
copiedInvocations[key] = value
|
||||
}
|
||||
return copiedInvocations
|
||||
}
|
||||
|
||||
func (fake *FakeTokenVerifier) recordInvocation(key string, args []interface{}) {
|
||||
fake.invocationsMutex.Lock()
|
||||
defer fake.invocationsMutex.Unlock()
|
||||
if fake.invocations == nil {
|
||||
fake.invocations = map[string][][]interface{}{}
|
||||
}
|
||||
if fake.invocations[key] == nil {
|
||||
fake.invocations[key] = [][]interface{}{}
|
||||
}
|
||||
fake.invocations[key] = append(fake.invocations[key], args)
|
||||
}
|
||||
|
||||
var _ auth.TokenVerifier = new(FakeTokenVerifier)
|
||||
@@ -1,18 +0,0 @@
|
||||
package auth
|
||||
|
||||
type VideoGrant struct {
|
||||
// actions on rooms
|
||||
RoomCreate bool `json:"roomCreate,omitempty"`
|
||||
RoomList bool `json:"roomList,omitempty"`
|
||||
|
||||
// actions on a particular room
|
||||
RoomAdmin bool `json:"roomAdmin,omitempty"`
|
||||
RoomJoin bool `json:"roomJoin,omitempty"`
|
||||
Room string `json:"room,omitempty"`
|
||||
}
|
||||
|
||||
type ClaimGrants struct {
|
||||
Identity string `json:"-"`
|
||||
Video *VideoGrant `json:"video,omitempty"`
|
||||
Metadata map[string]interface{} `json:"metadata,omitempty"`
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
|
||||
|
||||
var (
|
||||
ErrKeysMissing = errors.New("missing API key or secret key")
|
||||
)
|
||||
|
||||
//counterfeiter:generate . TokenVerifier
|
||||
type TokenVerifier interface {
|
||||
Identity() string
|
||||
Verify(key interface{}) (*ClaimGrants, error)
|
||||
}
|
||||
|
||||
//counterfeiter:generate . KeyProvider
|
||||
type KeyProvider interface {
|
||||
GetSecret(key string) string
|
||||
NumKeys() int
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"io"
|
||||
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
type FileBasedKeyProvider struct {
|
||||
keys map[string]string
|
||||
}
|
||||
|
||||
func NewFileBasedKeyProviderFromReader(r io.Reader) (p *FileBasedKeyProvider, err error) {
|
||||
keys := make(map[string]string)
|
||||
decoder := yaml.NewDecoder(r)
|
||||
if err = decoder.Decode(&keys); err != nil {
|
||||
return
|
||||
}
|
||||
p = &FileBasedKeyProvider{
|
||||
keys: keys,
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func NewFileBasedKeyProviderFromMap(keys map[string]string) *FileBasedKeyProvider {
|
||||
return &FileBasedKeyProvider{
|
||||
keys: keys,
|
||||
}
|
||||
}
|
||||
|
||||
func (p *FileBasedKeyProvider) GetSecret(key string) string {
|
||||
return p.keys[key]
|
||||
}
|
||||
|
||||
func (p *FileBasedKeyProvider) NumKeys() int {
|
||||
return len(p.keys)
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package auth_test
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/auth"
|
||||
)
|
||||
|
||||
func TestFileBasedKeyProvider(t *testing.T) {
|
||||
keys := map[string]string{
|
||||
"key1": "secret1",
|
||||
"key2": "secret2",
|
||||
"key3": "secret3",
|
||||
}
|
||||
f, err := ioutil.TempFile("", "keyfile")
|
||||
assert.NoError(t, err)
|
||||
defer func() {
|
||||
os.Remove(f.Name())
|
||||
}()
|
||||
|
||||
f.WriteString("key1: secret1\n")
|
||||
f.WriteString("key2: secret2 \r\n")
|
||||
f.WriteString("\n")
|
||||
f.WriteString("key3: secret3")
|
||||
|
||||
f.Close()
|
||||
|
||||
r, err := os.Open(f.Name())
|
||||
defer r.Close()
|
||||
p, err := auth.NewFileBasedKeyProviderFromReader(r)
|
||||
assert.NoError(t, err)
|
||||
|
||||
for key, val := range keys {
|
||||
assert.Equal(t, val, p.GetSecret(key))
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gopkg.in/square/go-jose.v2/jwt"
|
||||
)
|
||||
|
||||
type APIKeyTokenVerifier struct {
|
||||
token *jwt.JSONWebToken
|
||||
identity string
|
||||
apiKey string
|
||||
}
|
||||
|
||||
func ParseAPIToken(raw string) (*APIKeyTokenVerifier, error) {
|
||||
tok, err := jwt.ParseSigned(raw)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out := jwt.Claims{}
|
||||
if err := tok.UnsafeClaimsWithoutVerification(&out); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &APIKeyTokenVerifier{
|
||||
token: tok,
|
||||
apiKey: out.Issuer,
|
||||
identity: out.ID,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Returns the API key this token was signed with
|
||||
func (v *APIKeyTokenVerifier) APIKey() string {
|
||||
return v.apiKey
|
||||
}
|
||||
|
||||
func (v *APIKeyTokenVerifier) Identity() string {
|
||||
return v.identity
|
||||
}
|
||||
|
||||
func (v *APIKeyTokenVerifier) Verify(key interface{}) (*ClaimGrants, error) {
|
||||
if key == nil || key == "" {
|
||||
return nil, ErrKeysMissing
|
||||
}
|
||||
if s, ok := key.(string); ok {
|
||||
key = []byte(s)
|
||||
}
|
||||
out := jwt.Claims{}
|
||||
claims := ClaimGrants{}
|
||||
if err := v.token.Claims(key, &out, &claims); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := out.Validate(jwt.Expected{Issuer: v.apiKey, Time: time.Now()}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// copy over identity
|
||||
claims.Identity = out.ID
|
||||
return &claims, nil
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
package auth_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/auth"
|
||||
)
|
||||
|
||||
func TestVerifier(t *testing.T) {
|
||||
apiKey := "APID3B67uxk4Nj2GKiRPibAZ9"
|
||||
secret := "YHC-CUhbQhGeVCaYgn1BNA++"
|
||||
accessToken := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MDg5MzAzMDgsImlzcyI6IkFQSUQzQjY3dXhrNE5qMkdLaVJQaWJBWjkiLCJuYmYiOjE2MDg5MjY3MDgsInJvb21fam9pbiI6dHJ1ZSwicm9vbV9zaWQiOiJteWlkIiwic3ViIjoiQVBJRDNCNjd1eGs0TmoyR0tpUlBpYkFaOSJ9.cmHEBq0MLyRqphmVLM2cLXg5ao5Sro7am8yXhcYKcwE"
|
||||
t.Run("cannot decode with incorrect key", func(t *testing.T) {
|
||||
v, err := auth.ParseAPIToken(accessToken)
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.Equal(t, apiKey, v.APIKey())
|
||||
_, err = v.Verify("")
|
||||
assert.Error(t, err)
|
||||
|
||||
_, err = v.Verify("anothersecret")
|
||||
assert.Error(t, err)
|
||||
})
|
||||
|
||||
t.Run("key has expired", func(t *testing.T) {
|
||||
v, err := auth.ParseAPIToken(accessToken)
|
||||
|
||||
_, err = v.Verify(secret)
|
||||
assert.Error(t, err)
|
||||
})
|
||||
|
||||
t.Run("unexpired token is verified", func(t *testing.T) {
|
||||
claim := auth.VideoGrant{RoomCreate: true}
|
||||
at := auth.NewAccessToken(apiKey, secret).
|
||||
AddGrant(&claim).
|
||||
SetValidFor(time.Minute).
|
||||
SetIdentity("me")
|
||||
authToken, err := at.ToJWT()
|
||||
assert.NoError(t, err)
|
||||
|
||||
v, err := auth.ParseAPIToken(authToken)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, apiKey, v.APIKey())
|
||||
assert.Equal(t, "me", v.Identity())
|
||||
|
||||
decoded, err := v.Verify(secret)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, &claim, decoded.Video)
|
||||
})
|
||||
|
||||
t.Run("ensure metadata can be passed through", func(t *testing.T) {
|
||||
metadata := map[string]interface{}{
|
||||
"user": "value",
|
||||
"number": float64(3),
|
||||
}
|
||||
at := auth.NewAccessToken(apiKey, secret).
|
||||
AddGrant(&auth.VideoGrant{
|
||||
RoomAdmin: true,
|
||||
Room: "myroom",
|
||||
}).
|
||||
SetMetadata(metadata)
|
||||
|
||||
authToken, err := at.ToJWT()
|
||||
assert.NoError(t, err)
|
||||
|
||||
v, err := auth.ParseAPIToken(authToken)
|
||||
assert.NoError(t, err)
|
||||
|
||||
decoded, err := v.Verify(secret)
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.EqualValues(t, metadata, decoded.Metadata)
|
||||
})
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package routing
|
||||
import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/logger"
|
||||
"github.com/livekit/livekit-server/pkg/utils"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
"github.com/livekit/protocol/utils"
|
||||
)
|
||||
|
||||
// a router of messages on the same node, basic implementation for local testing
|
||||
|
||||
@@ -3,7 +3,7 @@ package routing
|
||||
import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/utils"
|
||||
"github.com/livekit/protocol/utils"
|
||||
)
|
||||
|
||||
type MessageChannel struct {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/routing"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
func TestMessageChannel_WriteMessageClosed(t *testing.T) {
|
||||
|
||||
+2
-2
@@ -13,8 +13,8 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/config"
|
||||
"github.com/livekit/livekit-server/pkg/utils"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
"github.com/livekit/protocol/utils"
|
||||
)
|
||||
|
||||
type NodeStats struct {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package routing
|
||||
|
||||
import (
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
"github.com/thoas/go-funk"
|
||||
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
)
|
||||
|
||||
type RandomSelector struct {
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"github.com/go-redis/redis/v8"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/utils"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
"github.com/livekit/protocol/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/logger"
|
||||
"github.com/livekit/livekit-server/pkg/utils"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
"github.com/livekit/protocol/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/routing"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
type FakeNodeSelector struct {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/routing"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
type FakeRouter struct {
|
||||
|
||||
@@ -5,9 +5,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
"github.com/thoas/go-funk"
|
||||
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
)
|
||||
|
||||
// checks if a node has been updated recently to be considered for selection
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/routing"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
func TestIsAvailable(t *testing.T) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/logger"
|
||||
"github.com/livekit/livekit-server/pkg/rtc/types"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -2,8 +2,8 @@ package rtc_test
|
||||
|
||||
import (
|
||||
"github.com/livekit/livekit-server/pkg/rtc/types/typesfakes"
|
||||
"github.com/livekit/livekit-server/pkg/utils"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
"github.com/livekit/protocol/utils"
|
||||
)
|
||||
|
||||
func newMockParticipant(identity string) *typesfakes.FakeParticipant {
|
||||
|
||||
@@ -15,8 +15,8 @@ import (
|
||||
"github.com/livekit/livekit-server/pkg/config"
|
||||
"github.com/livekit/livekit-server/pkg/logger"
|
||||
"github.com/livekit/livekit-server/pkg/rtc/types"
|
||||
"github.com/livekit/livekit-server/pkg/utils"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
"github.com/livekit/protocol/utils"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -18,9 +18,9 @@ import (
|
||||
"github.com/livekit/livekit-server/pkg/logger"
|
||||
"github.com/livekit/livekit-server/pkg/routing"
|
||||
"github.com/livekit/livekit-server/pkg/rtc/types"
|
||||
"github.com/livekit/livekit-server/pkg/utils"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
"github.com/livekit/livekit-server/version"
|
||||
"github.com/livekit/protocol/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"github.com/livekit/livekit-server/pkg/routing/routingfakes"
|
||||
"github.com/livekit/livekit-server/pkg/rtc/types"
|
||||
"github.com/livekit/livekit-server/pkg/rtc/types/typesfakes"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
//func Test
|
||||
|
||||
+2
-2
@@ -8,8 +8,8 @@ import (
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/logger"
|
||||
"github.com/livekit/livekit-server/pkg/rtc/types"
|
||||
"github.com/livekit/livekit-server/pkg/utils"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
"github.com/livekit/protocol/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"github.com/livekit/livekit-server/pkg/rtc"
|
||||
"github.com/livekit/livekit-server/pkg/rtc/types"
|
||||
"github.com/livekit/livekit-server/pkg/rtc/types/typesfakes"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"github.com/pion/ion-sfu/pkg/sfu"
|
||||
"github.com/pion/webrtc/v3"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/utils"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
"github.com/livekit/protocol/utils"
|
||||
)
|
||||
|
||||
type SubscribedTrack struct {
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/pion/webrtc/v3"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/logger"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/pion/webrtc/v3"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/routing"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/routing"
|
||||
"github.com/livekit/livekit-server/pkg/rtc/types"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
"github.com/pion/rtcp"
|
||||
webrtc "github.com/pion/webrtc/v3"
|
||||
)
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/rtc/types"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
type FakePublishedTrack struct {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/rtc/types"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
"github.com/pion/ion-sfu/pkg/sfu"
|
||||
)
|
||||
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/logger"
|
||||
"github.com/livekit/livekit-server/pkg/rtc/types"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
"github.com/twitchtv/twirp"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/auth"
|
||||
"github.com/livekit/protocol/auth"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -7,9 +7,9 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/auth"
|
||||
"github.com/livekit/livekit-server/pkg/auth/authfakes"
|
||||
"github.com/livekit/livekit-server/pkg/service"
|
||||
"github.com/livekit/protocol/auth"
|
||||
"github.com/livekit/protocol/auth/authfakes"
|
||||
)
|
||||
|
||||
func TestAuthMiddleware(t *testing.T) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/thoas/go-funk"
|
||||
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
// encapsulates CRUD operations for room settings
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/service"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
func TestParticipantPersisence(t *testing.T) {
|
||||
|
||||
@@ -13,8 +13,8 @@ import (
|
||||
"github.com/livekit/livekit-server/pkg/routing"
|
||||
"github.com/livekit/livekit-server/pkg/rtc"
|
||||
"github.com/livekit/livekit-server/pkg/rtc/types"
|
||||
"github.com/livekit/livekit-server/pkg/utils"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
"github.com/livekit/protocol/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/thoas/go-funk"
|
||||
"github.com/twitchtv/twirp"
|
||||
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
// A rooms service that supports a single node
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"github.com/livekit/livekit-server/pkg/logger"
|
||||
"github.com/livekit/livekit-server/pkg/routing"
|
||||
"github.com/livekit/livekit-server/pkg/rtc"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
type RTCService struct {
|
||||
|
||||
@@ -11,13 +11,13 @@ import (
|
||||
"github.com/pion/turn/v2"
|
||||
"github.com/urfave/negroni"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/auth"
|
||||
"github.com/livekit/livekit-server/pkg/config"
|
||||
"github.com/livekit/livekit-server/pkg/logger"
|
||||
"github.com/livekit/livekit-server/pkg/routing"
|
||||
"github.com/livekit/livekit-server/pkg/utils"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
"github.com/livekit/livekit-server/version"
|
||||
"github.com/livekit/protocol/auth"
|
||||
"github.com/livekit/protocol/utils"
|
||||
)
|
||||
|
||||
type LivekitServer struct {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/service"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
type FakeRoomStore struct {
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/config"
|
||||
"github.com/livekit/livekit-server/pkg/logger"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
var ServiceSet = wire.NewSet(
|
||||
|
||||
+1
-1
@@ -5,9 +5,9 @@ package service
|
||||
import (
|
||||
"github.com/google/wire"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/auth"
|
||||
"github.com/livekit/livekit-server/pkg/config"
|
||||
"github.com/livekit/livekit-server/pkg/routing"
|
||||
"github.com/livekit/protocol/auth"
|
||||
)
|
||||
|
||||
func InitializeServer(conf *config.Config, keyProvider auth.KeyProvider,
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"github.com/livekit/livekit-server/pkg/auth"
|
||||
"github.com/livekit/livekit-server/pkg/config"
|
||||
"github.com/livekit/livekit-server/pkg/routing"
|
||||
"github.com/livekit/protocol/auth"
|
||||
)
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/logger"
|
||||
"github.com/livekit/livekit-server/pkg/rtc/types"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/go-redis/redis/v8"
|
||||
"github.com/karlseguin/ccache/v2"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
const (
|
||||
defaultCacheTTL = time.Minute
|
||||
)
|
||||
|
||||
type CachedRedis struct {
|
||||
ctx context.Context
|
||||
rc *redis.Client
|
||||
cache *ccache.Cache
|
||||
}
|
||||
|
||||
func NewCachedRedis(ctx context.Context, rc *redis.Client) *CachedRedis {
|
||||
return &CachedRedis{
|
||||
ctx: ctx,
|
||||
rc: rc,
|
||||
cache: ccache.New(ccache.Configure()),
|
||||
}
|
||||
}
|
||||
|
||||
func (r *CachedRedis) CachedHGet(key, hashKey string) (string, error) {
|
||||
cacheKey := key + ":" + hashKey
|
||||
item := r.cache.Get(cacheKey)
|
||||
if item != nil && !item.Expired() {
|
||||
return item.Value().(string), nil
|
||||
}
|
||||
val, err := r.rc.HGet(r.ctx, key, hashKey).Result()
|
||||
if err != nil {
|
||||
return "", errors.Wrapf(err, "could not hget %s[%s]", key, hashKey)
|
||||
}
|
||||
r.cache.Set(key, val, defaultCacheTTL)
|
||||
return val, nil
|
||||
}
|
||||
|
||||
func (r *CachedRedis) CachedGet(key string) (string, error) {
|
||||
item := r.cache.Get(key)
|
||||
if item != nil && !item.Expired() {
|
||||
return item.Value().(string), nil
|
||||
}
|
||||
val, err := r.rc.Get(r.ctx, key).Result()
|
||||
if err != nil {
|
||||
return "", errors.Wrapf(err, "could not get %s", key)
|
||||
}
|
||||
|
||||
r.cache.Set(key, val, defaultCacheTTL)
|
||||
return val, nil
|
||||
}
|
||||
|
||||
func (r *CachedRedis) ExpireHash(key, hashKey string) {
|
||||
r.cache.Delete(key + ":" + hashKey)
|
||||
}
|
||||
|
||||
func (r *CachedRedis) Expire(key string) {
|
||||
r.cache.Delete(key)
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"crypto/sha1"
|
||||
|
||||
"github.com/lithammer/shortuuid/v3"
|
||||
"github.com/lytics/base62"
|
||||
)
|
||||
|
||||
const (
|
||||
RoomPrefix = "RM_"
|
||||
NodePrefix = "ND_"
|
||||
ParticipantPrefix = "PA_"
|
||||
TrackPrefix = "TR_"
|
||||
APIKeyPrefix = "API"
|
||||
)
|
||||
|
||||
func NewGuid(prefix string) string {
|
||||
return prefix + shortuuid.New()[:12]
|
||||
}
|
||||
|
||||
// Creates a hashed ID from a unique string
|
||||
func HashedID(str string) string {
|
||||
h := sha1.New()
|
||||
h.Write([]byte(str))
|
||||
val := h.Sum(nil)
|
||||
|
||||
return base62.StdEncoding.EncodeToString(val)
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"io"
|
||||
|
||||
"github.com/lytics/base62"
|
||||
)
|
||||
|
||||
func RandomSecret() string {
|
||||
// 256 bit secret
|
||||
buf := make([]byte, 32)
|
||||
_, err := io.ReadFull(rand.Reader, buf)
|
||||
// cannot error
|
||||
if err != nil {
|
||||
panic("could not read random")
|
||||
}
|
||||
return base62.StdEncoding.EncodeToString(buf)
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"sync/atomic"
|
||||
)
|
||||
|
||||
var (
|
||||
ErrChannelClosed = errors.New("cannot write to closed channel")
|
||||
)
|
||||
|
||||
type AtomicFlag struct {
|
||||
val int32
|
||||
}
|
||||
|
||||
// set flag to value if existing flag is different, otherwise return
|
||||
func (b *AtomicFlag) TrySet(bVal bool) bool {
|
||||
var v int32
|
||||
if bVal {
|
||||
v = 1
|
||||
}
|
||||
prev := atomic.SwapInt32(&b.val, v)
|
||||
// already set. unsuccessful
|
||||
if prev == v {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (b *AtomicFlag) Get() bool {
|
||||
return atomic.LoadInt32(&b.val) == 1
|
||||
}
|
||||
|
||||
// a channel that ignores writes when it closes instead of panic
|
||||
type CalmChannel struct {
|
||||
channel chan interface{}
|
||||
isClosed AtomicFlag
|
||||
}
|
||||
|
||||
func NewCalmChannel(size int) *CalmChannel {
|
||||
return &CalmChannel{
|
||||
channel: make(chan interface{}, size),
|
||||
}
|
||||
}
|
||||
|
||||
func (c *CalmChannel) Close() {
|
||||
if !c.isClosed.TrySet(true) {
|
||||
return
|
||||
}
|
||||
close(c.channel)
|
||||
}
|
||||
|
||||
func (c *CalmChannel) ReadChan() <-chan interface{} {
|
||||
return c.channel
|
||||
}
|
||||
|
||||
func (c *CalmChannel) Write(o interface{}) error {
|
||||
if c.isClosed.Get() {
|
||||
return ErrChannelClosed
|
||||
}
|
||||
c.channel <- o
|
||||
return nil
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestAtomicFlag(t *testing.T) {
|
||||
t.Run("single thread, basic functionality", func(t *testing.T) {
|
||||
f := AtomicFlag{}
|
||||
assert.False(t, f.TrySet(false))
|
||||
assert.False(t, f.Get())
|
||||
assert.True(t, f.TrySet(true))
|
||||
assert.True(t, f.Get())
|
||||
})
|
||||
|
||||
t.Run("only one thread should succeed", func(t *testing.T) {
|
||||
var numSets uint32
|
||||
f := AtomicFlag{}
|
||||
wg := sync.WaitGroup{}
|
||||
for i := 0; i < 10; i++ {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
if f.TrySet(true) {
|
||||
atomic.AddUint32(&numSets, 1)
|
||||
}
|
||||
wg.Done()
|
||||
}()
|
||||
}
|
||||
wg.Wait()
|
||||
|
||||
assert.Equal(t, 1, int(numSets))
|
||||
})
|
||||
}
|
||||
|
||||
func TestCalmChannel(t *testing.T) {
|
||||
t.Run("should receive nil after close", func(t *testing.T) {
|
||||
c := NewCalmChannel(1)
|
||||
c.Close()
|
||||
|
||||
assert.Equal(t, nil, <-c.ReadChan())
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,802 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.15.5
|
||||
// source: internal.proto
|
||||
|
||||
package livekit
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
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)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
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
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package livekit;
|
||||
option go_package = "github.com/livekit/livekit-server/proto/livekit";
|
||||
|
||||
// internal protos, not exposed to clients
|
||||
import "rtc.proto";
|
||||
import "room.proto";
|
||||
|
||||
message Node {
|
||||
string id = 1;
|
||||
string ip = 2;
|
||||
uint32 num_cpus = 3;
|
||||
NodeStats stats = 4;
|
||||
}
|
||||
|
||||
message NodeStats {
|
||||
// when server was started
|
||||
int64 started_at = 1;
|
||||
// when server last reported its status
|
||||
int64 updated_at = 2;
|
||||
uint32 num_rooms = 3;
|
||||
uint32 num_clients = 4;
|
||||
uint32 num_tracks_in = 5;
|
||||
uint32 num_tracks_out = 6;
|
||||
}
|
||||
|
||||
// message to RTC nodes
|
||||
message RTCNodeMessage {
|
||||
string participant_key = 1;
|
||||
oneof message {
|
||||
StartSession start_session = 2;
|
||||
SignalRequest request = 3;
|
||||
// internal messages
|
||||
RoomParticipantIdentity remove_participant = 4;
|
||||
MuteRoomTrackRequest mute_track = 5;
|
||||
}
|
||||
}
|
||||
|
||||
// message to Signal nodes
|
||||
message SignalNodeMessage {
|
||||
string connection_id = 1;
|
||||
oneof message {
|
||||
SignalResponse response = 2;
|
||||
EndSession end_session = 3;
|
||||
}
|
||||
}
|
||||
|
||||
message StartSession {
|
||||
string room_name = 1;
|
||||
string identity = 2;
|
||||
string connection_id = 3;
|
||||
// if a client is reconnecting (i.e. resume instead of restart)
|
||||
bool reconnect = 4;
|
||||
// metadata to pass to participant
|
||||
string metadata = 5;
|
||||
}
|
||||
|
||||
message EndSession {
|
||||
}
|
||||
|
||||
message RemoveParticipant {
|
||||
string participant_id = 1;
|
||||
}
|
||||
@@ -0,0 +1,614 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.15.5
|
||||
// source: model.proto
|
||||
|
||||
package livekit
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
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)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
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
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package livekit;
|
||||
option go_package = "github.com/livekit/livekit-server/proto/livekit";
|
||||
|
||||
message Room {
|
||||
string sid = 1;
|
||||
string name = 2;
|
||||
uint32 empty_timeout = 3;
|
||||
uint32 max_participants = 4;
|
||||
int64 creation_time = 5;
|
||||
string turn_password = 6;
|
||||
}
|
||||
|
||||
message ParticipantInfo {
|
||||
enum State {
|
||||
// websocket' connected, but not offered yet
|
||||
JOINING = 0;
|
||||
// server received client offer
|
||||
JOINED = 1;
|
||||
// ICE connectivity established
|
||||
ACTIVE = 2;
|
||||
// WS disconnected
|
||||
DISCONNECTED = 3;
|
||||
}
|
||||
string sid = 1;
|
||||
string identity = 2;
|
||||
State state = 3;
|
||||
repeated TrackInfo tracks = 4;
|
||||
string metadata = 5;
|
||||
}
|
||||
|
||||
enum TrackType {
|
||||
AUDIO = 0;
|
||||
VIDEO = 1;
|
||||
DATA = 2;
|
||||
}
|
||||
|
||||
message TrackInfo {
|
||||
string sid = 1;
|
||||
TrackType type = 2;
|
||||
string name = 3;
|
||||
bool muted = 4;
|
||||
}
|
||||
|
||||
message DataMessage {
|
||||
oneof value {
|
||||
string text = 1;
|
||||
bytes binary = 2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,879 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.15.5
|
||||
// source: room.proto
|
||||
|
||||
package livekit
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
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)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
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
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package livekit;
|
||||
option go_package = "github.com/livekit/livekit-server/proto/livekit";
|
||||
|
||||
import "model.proto";
|
||||
|
||||
// Room service that can be performed on any node
|
||||
// they are Twirp-based HTTP req/responses
|
||||
service RoomService {
|
||||
|
||||
// should be accessible to only internal servers, not external
|
||||
rpc CreateRoom(CreateRoomRequest) returns (Room);
|
||||
rpc ListRooms(ListRoomsRequest) returns (ListRoomsResponse);
|
||||
rpc DeleteRoom(DeleteRoomRequest) returns (DeleteRoomResponse);
|
||||
|
||||
// lists participants in a room, requires RoomAdmin
|
||||
rpc ListParticipants(ListParticipantsRequest) returns (ListParticipantsResponse);
|
||||
// get information on a specific participant, requires RoomAdmin
|
||||
rpc GetParticipant(RoomParticipantIdentity) returns (ParticipantInfo);
|
||||
// removes a participant from room, requires RoomAdmin
|
||||
rpc RemoveParticipant(RoomParticipantIdentity) returns (RemoveParticipantResponse);
|
||||
|
||||
// mute/unmute a participant, requires RoomAdmin
|
||||
rpc MutePublishedTrack(MuteRoomTrackRequest) returns (MuteRoomTrackResponse);
|
||||
}
|
||||
|
||||
message CreateRoomRequest {
|
||||
string name = 1;
|
||||
// number of seconds the room should cleanup after being empty
|
||||
uint32 empty_timeout = 2;
|
||||
uint32 max_participants = 3;
|
||||
// override the node room is allocated to, for debugging
|
||||
string node_id = 4;
|
||||
}
|
||||
|
||||
message ListRoomsRequest {
|
||||
}
|
||||
|
||||
message ListRoomsResponse {
|
||||
repeated Room rooms = 1;
|
||||
}
|
||||
|
||||
message DeleteRoomRequest {
|
||||
string room = 1;
|
||||
}
|
||||
|
||||
message DeleteRoomResponse {
|
||||
}
|
||||
|
||||
message ListParticipantsRequest {
|
||||
string room = 1;
|
||||
}
|
||||
|
||||
message ListParticipantsResponse {
|
||||
repeated ParticipantInfo participants = 1;
|
||||
}
|
||||
|
||||
message RoomParticipantIdentity {
|
||||
string room = 1;
|
||||
string identity = 2;
|
||||
}
|
||||
|
||||
message RemoveParticipantResponse {
|
||||
}
|
||||
|
||||
message MuteRoomTrackRequest {
|
||||
string room = 1;
|
||||
string identity = 2;
|
||||
string track_sid = 3;
|
||||
bool muted = 4;
|
||||
}
|
||||
|
||||
message MuteRoomTrackResponse {
|
||||
TrackInfo track = 1;
|
||||
}
|
||||
+2732
File diff suppressed because it is too large
Load Diff
+1639
File diff suppressed because it is too large
Load Diff
-127
@@ -1,127 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package livekit;
|
||||
option go_package = "github.com/livekit/livekit-server/proto/livekit";
|
||||
|
||||
import "model.proto";
|
||||
|
||||
message SignalRequest {
|
||||
oneof message {
|
||||
// initial join exchange, for publisher
|
||||
SessionDescription offer = 1;
|
||||
// participant answering publisher offer
|
||||
SessionDescription answer = 2;
|
||||
TrickleRequest trickle = 3;
|
||||
AddTrackRequest add_track = 4;
|
||||
// mute the participant's own tracks
|
||||
MuteTrackRequest mute = 5;
|
||||
// Subscribe or unsubscribe from tracks
|
||||
UpdateSubscription subscription = 6;
|
||||
// Update settings of subscribed tracks
|
||||
UpdateTrackSettings track_setting = 7;
|
||||
}
|
||||
}
|
||||
|
||||
message SignalResponse {
|
||||
oneof message {
|
||||
// sent when join is accepted
|
||||
JoinResponse join = 1;
|
||||
// sent when server answers publisher
|
||||
SessionDescription answer = 2;
|
||||
// sent when server is sending subscriber an offer
|
||||
SessionDescription offer = 3;
|
||||
// sent when an ICE candidate is available
|
||||
TrickleRequest trickle = 4;
|
||||
// sent when participants in the room has changed
|
||||
ParticipantUpdate update = 5;
|
||||
// sent to the participant when their track has been published
|
||||
TrackPublishedResponse track_published = 6;
|
||||
// list of active speakers
|
||||
ActiveSpeakerUpdate speaker = 7;
|
||||
}
|
||||
}
|
||||
|
||||
enum SignalTarget {
|
||||
PUBLISHER = 0;
|
||||
SUBSCRIBER = 1;
|
||||
}
|
||||
|
||||
message AddTrackRequest {
|
||||
// client ID of track, to match it when RTC track is received
|
||||
string cid = 1;
|
||||
string name = 2;
|
||||
TrackType type = 3;
|
||||
}
|
||||
|
||||
message TrickleRequest {
|
||||
string candidateInit = 1;
|
||||
SignalTarget target = 2;
|
||||
}
|
||||
|
||||
message MuteTrackRequest {
|
||||
string sid = 1;
|
||||
bool muted = 2;
|
||||
}
|
||||
|
||||
message NegotiationRequest {
|
||||
// empty
|
||||
}
|
||||
|
||||
message JoinResponse {
|
||||
Room room = 1;
|
||||
ParticipantInfo participant = 2;
|
||||
repeated ParticipantInfo other_participants = 3;
|
||||
string server_version = 4;
|
||||
repeated ICEServer ice_servers = 5;
|
||||
}
|
||||
|
||||
message TrackPublishedResponse {
|
||||
string cid = 1;
|
||||
TrackInfo track = 2;
|
||||
}
|
||||
|
||||
message SessionDescription {
|
||||
string type = 1; // "answer" | "offer" | "pranswer" | "rollback"
|
||||
string sdp = 2;
|
||||
}
|
||||
|
||||
message ParticipantUpdate {
|
||||
repeated ParticipantInfo participants = 1;
|
||||
}
|
||||
|
||||
message ActiveSpeakerUpdate {
|
||||
repeated SpeakerInfo speakers = 1;
|
||||
}
|
||||
|
||||
message SpeakerInfo {
|
||||
string sid = 1;
|
||||
// audio level, 0-1.0, 1 is loudest
|
||||
float level = 2;
|
||||
// true if speaker is currently active
|
||||
bool active = 3;
|
||||
}
|
||||
|
||||
enum VideoQuality {
|
||||
LOW = 0;
|
||||
MEDIUM = 1;
|
||||
HIGH = 2;
|
||||
}
|
||||
|
||||
message UpdateSubscription {
|
||||
repeated string track_sids = 1;
|
||||
bool subscribe = 2;
|
||||
bool mute = 3;
|
||||
VideoQuality quality = 4;
|
||||
}
|
||||
|
||||
message UpdateTrackSettings {
|
||||
repeated string track_sids = 1;
|
||||
bool mute = 3;
|
||||
VideoQuality quality = 4;
|
||||
}
|
||||
|
||||
message ICEServer {
|
||||
repeated string urls = 1;
|
||||
string username = 2;
|
||||
string credential = 3;
|
||||
}
|
||||
@@ -12,13 +12,13 @@ import (
|
||||
"github.com/twitchtv/twirp"
|
||||
|
||||
"github.com/livekit/livekit-server/cmd/cli/client"
|
||||
"github.com/livekit/livekit-server/pkg/auth"
|
||||
"github.com/livekit/livekit-server/pkg/config"
|
||||
"github.com/livekit/livekit-server/pkg/logger"
|
||||
"github.com/livekit/livekit-server/pkg/routing"
|
||||
"github.com/livekit/livekit-server/pkg/service"
|
||||
"github.com/livekit/livekit-server/pkg/utils"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
"github.com/livekit/protocol/auth"
|
||||
"github.com/livekit/protocol/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/logger"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
)
|
||||
|
||||
func TestMultiNodeRouting(t *testing.T) {
|
||||
@@ -115,8 +115,8 @@ func TestMultinodeReconnectAfterNodeShutdown(t *testing.T) {
|
||||
return
|
||||
}
|
||||
|
||||
logger.Infow("\n\n---Starting TestMultiNodeRouting---")
|
||||
defer logger.Infow("---Finishing TestMultiNodeRouting---")
|
||||
logger.Infow("\n\n---Starting TestMultinodeReconnectAfterNodeShutdown---")
|
||||
defer logger.Infow("---Finishing TestMultinodeReconnectAfterNodeShutdown---")
|
||||
|
||||
s1, s2 := setupMultiNodeTest()
|
||||
defer s1.Stop()
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ import (
|
||||
"github.com/livekit/livekit-server/pkg/config"
|
||||
"github.com/livekit/livekit-server/pkg/routing"
|
||||
"github.com/livekit/livekit-server/pkg/service"
|
||||
"github.com/livekit/livekit-server/pkg/utils"
|
||||
"github.com/livekit/livekit-server/proto/livekit"
|
||||
livekit "github.com/livekit/livekit-server/proto"
|
||||
"github.com/livekit/protocol/utils"
|
||||
)
|
||||
|
||||
func TestTurnServer(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user