diff --git a/cmd/server/commands.go b/cmd/server/commands.go index 2a0a52ec9..a30281237 100644 --- a/cmd/server/commands.go +++ b/cmd/server/commands.go @@ -6,13 +6,14 @@ import ( "strconv" "time" - "github.com/livekit/livekit-server/pkg/routing" - "github.com/livekit/livekit-server/pkg/service" "github.com/livekit/protocol/auth" "github.com/livekit/protocol/utils" "github.com/olekukonko/tablewriter" "github.com/urfave/cli/v2" "gopkg.in/yaml.v3" + + "github.com/livekit/livekit-server/pkg/routing" + "github.com/livekit/livekit-server/pkg/service" ) func generateKeys(c *cli.Context) error { diff --git a/cmd/server/main.go b/cmd/server/main.go index 2c2b02e61..58b10ace2 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -11,11 +11,10 @@ import ( "syscall" "time" + "github.com/livekit/protocol/auth" "github.com/pkg/errors" "github.com/urfave/cli/v2" - "github.com/livekit/protocol/auth" - "github.com/livekit/livekit-server/pkg/config" "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/routing" diff --git a/go.mod b/go.mod index dc5dc03e7..ed8d1b5e5 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/google/wire v0.5.0 github.com/gorilla/websocket v1.4.2 github.com/jxskiss/base62 v0.0.0-20191017122030-4f11678b909b - github.com/livekit/protocol v0.7.8 + github.com/livekit/protocol v0.8.0 github.com/magefile/mage v1.11.0 github.com/maxbrunsfeld/counterfeiter/v6 v6.3.0 github.com/mitchellh/go-homedir v1.1.0 diff --git a/go.sum b/go.sum index de0967ab4..ba792bf4d 100644 --- a/go.sum +++ b/go.sum @@ -241,8 +241,8 @@ github.com/lithammer/shortuuid/v3 v3.0.6 h1:pr15YQyvhiSX/qPxncFtqk+v4xLEpOZObbsY github.com/lithammer/shortuuid/v3 v3.0.6/go.mod h1:vMk8ke37EmiewwolSO1NLW8vP4ZaKlRuDIi8tWWmAts= github.com/livekit/ion-sfu v1.20.8 h1:nNyih1cq82dmuBv41XKH3qTDFtRvTnHwCKmUBFGz/Vc= github.com/livekit/ion-sfu v1.20.8/go.mod h1:g8hwobZI5fvX1RXvayf4ZXkgP7spV5YGE4yTSsumpB4= -github.com/livekit/protocol v0.7.8 h1:UqiJ3iv3D9aDK5swIj1zW1AjeNSatXC9EWtLMe3XW+U= -github.com/livekit/protocol v0.7.8/go.mod h1:Vk04t1uIJa+U2L5SeANEmDl6ebjc9tKVi4kk3CpqW74= +github.com/livekit/protocol v0.8.0 h1:cfiSy12WUozFBLi0dE6LEoignJOOPra0Fvf/5MJOI1I= +github.com/livekit/protocol v0.8.0/go.mod h1:OczgiKz3Uo6g35oav5g/m3fAFrxd1sROWKmOj3wsVx0= 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= diff --git a/magefile.go b/magefile.go index 953b4a28a..775b50060 100644 --- a/magefile.go +++ b/magefile.go @@ -4,7 +4,6 @@ package main import ( "crypto/sha1" - "encoding/json" "errors" "fmt" "go/build" @@ -15,10 +14,8 @@ import ( "path/filepath" "sort" "strings" - "time" "github.com/magefile/mage/mg" - "github.com/magefile/mage/target" "github.com/livekit/livekit-server/version" ) @@ -45,101 +42,9 @@ func Deps() error { return installTools(true) } -type modInfo struct { - Path string - Version string - Time time.Time - Dir string - GoMod string - GoVersion string -} - -// regenerate protobuf -func Proto() error { - cmd := exec.Command("go", "list", "-m", "-json", "github.com/livekit/protocol") - out, err := cmd.Output() - if err != nil { - return err - } - info := modInfo{} - if err = json.Unmarshal(out, &info); err != nil { - return err - } - protoDir := info.Dir - updated, err := target.Path("proto/livekit_models.pb.go", - protoDir+"/livekit_internal.proto", - protoDir+"/livekit_models.proto", - protoDir+"/livekit_recording.proto", - protoDir+"/livekit_room.proto", - protoDir+"/livekit_rtc.proto", - protoDir+"/livekit_webhook.proto", - ) - if err != nil { - return err - } - if !updated { - return nil - } - - fmt.Println("generating protobuf") - target := "proto" - if err := os.MkdirAll(target, 0755); err != nil { - return err - } - - protoc, err := getToolPath("protoc") - if err != nil { - return err - } - protocGoPath, err := getToolPath("protoc-gen-go") - if err != nil { - return err - } - twirpPath, err := getToolPath("protoc-gen-twirp") - if err != nil { - return err - } - - // generate twirp-related protos - cmd = exec.Command(protoc, - "--go_out", target, - "--twirp_out", target, - "--go_opt=paths=source_relative", - "--twirp_opt=paths=source_relative", - "--plugin=go="+protocGoPath, - "--plugin=twirp="+twirpPath, - "-I="+protoDir, - protoDir+"/livekit_recording.proto", - protoDir+"/livekit_room.proto", - ) - connectStd(cmd) - if err := cmd.Run(); err != nil { - return err - } - - // generate basic protobuf - cmd = exec.Command(protoc, - "--go_out", target, - "--go_opt=paths=source_relative", - "--plugin=go="+protocGoPath, - "-I="+protoDir, - protoDir+"/livekit_recording.proto", - protoDir+"/livekit_rtc.proto", - protoDir+"/livekit_internal.proto", - protoDir+"/livekit_models.proto", - protoDir+"/livekit_webhook.proto", - ) - connectStd(cmd) - if err := cmd.Run(); err != nil { - return err - } - - return nil -} - // builds LiveKit server func Build() error { - mg.Deps(Proto, generateWire) + mg.Deps(generateWire) if !checksummer.IsChanged() { fmt.Println("up to date") return nil @@ -162,7 +67,7 @@ func Build() error { // builds binary that runs on linux amd64 func BuildLinux() error { - mg.Deps(Proto, generateWire) + mg.Deps(generateWire) if !checksummer.IsChanged() { fmt.Println("up to date") return nil @@ -191,7 +96,7 @@ func BuildLinux() error { // builds docker image for LiveKit server func Docker() error { - mg.Deps(Proto, generateWire) + mg.Deps(generateWire) cmd := exec.Command("docker", "build", ".", "-t", fmt.Sprintf("%s:v%s", imageName, version.Version)) connectStd(cmd) if err := cmd.Run(); err != nil { @@ -219,7 +124,6 @@ func PublishDocker() error { // run unit tests, skipping integration func Test() error { - mg.Deps(Proto) cmd := exec.Command("go", "test", "-short", "./...") connectStd(cmd) return cmd.Run() @@ -227,7 +131,6 @@ func Test() error { // run all tests including integration func TestAll() error { - mg.Deps(Proto) // "-v", "-race", cmd := exec.Command("go", "test", "./...", "-count=1", "-timeout=3m") connectStd(cmd) @@ -243,7 +146,7 @@ func Clean() { // regenerate code func Generate() error { - mg.Deps(installDeps, Proto) + mg.Deps(installDeps) fmt.Println("generating...") @@ -254,7 +157,7 @@ func Generate() error { // code generation for wiring func generateWire() error { - mg.Deps(installDeps, Proto) + mg.Deps(installDeps) if !checksummer.IsChanged() { return nil } @@ -286,13 +189,7 @@ func installDeps() error { } func installTools(force bool) error { - if _, err := getToolPath("protoc"); err != nil { - return fmt.Errorf("protoc is required but is not found") - } - tools := []string{ - "google.golang.org/protobuf/cmd/protoc-gen-go", - "github.com/twitchtv/twirp/protoc-gen-twirp", "github.com/google/wire/cmd/wire", } for _, t := range tools { diff --git a/pkg/routing/interfaces.go b/pkg/routing/interfaces.go index fdae4d994..34c4beb38 100644 --- a/pkg/routing/interfaces.go +++ b/pkg/routing/interfaces.go @@ -1,9 +1,8 @@ package routing import ( + livekit "github.com/livekit/protocol/proto" "google.golang.org/protobuf/proto" - - livekit "github.com/livekit/livekit-server/proto" ) //go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate diff --git a/pkg/routing/localrouter.go b/pkg/routing/localrouter.go index c6398db2b..45bd637af 100644 --- a/pkg/routing/localrouter.go +++ b/pkg/routing/localrouter.go @@ -4,11 +4,11 @@ import ( "sync" "time" + livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/utils" "google.golang.org/protobuf/proto" "github.com/livekit/livekit-server/pkg/logger" - livekit "github.com/livekit/livekit-server/proto" ) // a router of messages on the same node, basic implementation for local testing diff --git a/pkg/routing/messagechannel_test.go b/pkg/routing/messagechannel_test.go index ff938d9e6..0d7907e08 100644 --- a/pkg/routing/messagechannel_test.go +++ b/pkg/routing/messagechannel_test.go @@ -4,8 +4,9 @@ import ( "sync" "testing" + livekit "github.com/livekit/protocol/proto" + "github.com/livekit/livekit-server/pkg/routing" - livekit "github.com/livekit/livekit-server/proto" ) func TestMessageChannel_WriteMessageClosed(t *testing.T) { diff --git a/pkg/routing/node.go b/pkg/routing/node.go index fff45a901..3fb299bbc 100644 --- a/pkg/routing/node.go +++ b/pkg/routing/node.go @@ -8,10 +8,10 @@ import ( "time" "github.com/jxskiss/base62" + livekit "github.com/livekit/protocol/proto" + "github.com/livekit/protocol/utils" "github.com/livekit/livekit-server/pkg/config" - livekit "github.com/livekit/livekit-server/proto" - "github.com/livekit/protocol/utils" ) type NodeStats struct { diff --git a/pkg/routing/redis.go b/pkg/routing/redis.go index 5555d4548..221059a2b 100644 --- a/pkg/routing/redis.go +++ b/pkg/routing/redis.go @@ -4,10 +4,9 @@ import ( "context" "github.com/go-redis/redis/v8" - "google.golang.org/protobuf/proto" - - livekit "github.com/livekit/livekit-server/proto" + livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/utils" + "google.golang.org/protobuf/proto" ) const ( diff --git a/pkg/routing/redisrouter.go b/pkg/routing/redisrouter.go index e8ce10a97..077e35c60 100644 --- a/pkg/routing/redisrouter.go +++ b/pkg/routing/redisrouter.go @@ -5,13 +5,13 @@ import ( "time" "github.com/go-redis/redis/v8" + livekit "github.com/livekit/protocol/proto" + "github.com/livekit/protocol/utils" "github.com/pkg/errors" "google.golang.org/protobuf/proto" "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/utils/stats" - livekit "github.com/livekit/livekit-server/proto" - "github.com/livekit/protocol/utils" ) const ( diff --git a/pkg/routing/routingfakes/fake_node_selector.go b/pkg/routing/routingfakes/fake_node_selector.go index 9cded4fda..ddf3ae45f 100644 --- a/pkg/routing/routingfakes/fake_node_selector.go +++ b/pkg/routing/routingfakes/fake_node_selector.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/livekit/livekit-server/pkg/routing" - livekit "github.com/livekit/livekit-server/proto" + livekit "github.com/livekit/protocol/proto" ) type FakeNodeSelector struct { diff --git a/pkg/routing/routingfakes/fake_router.go b/pkg/routing/routingfakes/fake_router.go index 6c6b0a2c6..91a809c3a 100644 --- a/pkg/routing/routingfakes/fake_router.go +++ b/pkg/routing/routingfakes/fake_router.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/livekit/livekit-server/pkg/routing" - livekit "github.com/livekit/livekit-server/proto" + livekit "github.com/livekit/protocol/proto" ) type FakeRouter struct { diff --git a/pkg/routing/selectorrandom.go b/pkg/routing/selectorrandom.go index 70279b5c3..deac3c556 100644 --- a/pkg/routing/selectorrandom.go +++ b/pkg/routing/selectorrandom.go @@ -1,7 +1,7 @@ package routing import ( - livekit "github.com/livekit/livekit-server/proto" + livekit "github.com/livekit/protocol/proto" "github.com/thoas/go-funk" ) diff --git a/pkg/routing/selectorsystemload.go b/pkg/routing/selectorsystemload.go index 1ecb83ad1..9f8f97683 100644 --- a/pkg/routing/selectorsystemload.go +++ b/pkg/routing/selectorsystemload.go @@ -1,7 +1,7 @@ package routing import ( - livekit "github.com/livekit/livekit-server/proto" + livekit "github.com/livekit/protocol/proto" "github.com/thoas/go-funk" ) @@ -15,7 +15,7 @@ func (s *SystemLoadSelector) SelectNode(nodes []*livekit.Node, room *livekit.Roo return nil, ErrNoAvailableNodes } - nodesLowLoad := []*livekit.Node{} + nodesLowLoad := make([]*livekit.Node, 0) for _, node := range nodes { numCpus := node.Stats.NumCpus if numCpus == 0 { diff --git a/pkg/routing/selectorsystemload_test.go b/pkg/routing/selectorsystemload_test.go index 943acb12c..41aaa7f76 100644 --- a/pkg/routing/selectorsystemload_test.go +++ b/pkg/routing/selectorsystemload_test.go @@ -4,9 +4,10 @@ import ( "testing" "time" - "github.com/livekit/livekit-server/pkg/routing" - livekit "github.com/livekit/livekit-server/proto" + livekit "github.com/livekit/protocol/proto" "github.com/stretchr/testify/require" + + "github.com/livekit/livekit-server/pkg/routing" ) var ( diff --git a/pkg/routing/utils.go b/pkg/routing/utils.go index c50e7f94d..7ba17bbee 100644 --- a/pkg/routing/utils.go +++ b/pkg/routing/utils.go @@ -5,7 +5,7 @@ import ( "strings" "time" - livekit "github.com/livekit/livekit-server/proto" + livekit "github.com/livekit/protocol/proto" "github.com/thoas/go-funk" ) diff --git a/pkg/routing/utils_test.go b/pkg/routing/utils_test.go index 34b54376f..715b0e19f 100644 --- a/pkg/routing/utils_test.go +++ b/pkg/routing/utils_test.go @@ -4,9 +4,10 @@ import ( "testing" "time" - "github.com/livekit/livekit-server/pkg/routing" - livekit "github.com/livekit/livekit-server/proto" + livekit "github.com/livekit/protocol/proto" "github.com/stretchr/testify/require" + + "github.com/livekit/livekit-server/pkg/routing" ) func TestIsAvailable(t *testing.T) { diff --git a/pkg/rtc/helper_test.go b/pkg/rtc/helper_test.go index 410a346d7..05d569aae 100644 --- a/pkg/rtc/helper_test.go +++ b/pkg/rtc/helper_test.go @@ -1,11 +1,11 @@ package rtc_test import ( + livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/utils" "github.com/livekit/livekit-server/pkg/rtc/types" "github.com/livekit/livekit-server/pkg/rtc/types/typesfakes" - livekit "github.com/livekit/livekit-server/proto" ) func newMockParticipant(identity string, protocol types.ProtocolVersion, hidden bool) *typesfakes.FakeParticipant { diff --git a/pkg/rtc/mediaengine.go b/pkg/rtc/mediaengine.go index 207d5a25d..dd639bb90 100644 --- a/pkg/rtc/mediaengine.go +++ b/pkg/rtc/mediaengine.go @@ -3,7 +3,7 @@ package rtc import ( "strings" - livekit "github.com/livekit/livekit-server/proto" + livekit "github.com/livekit/protocol/proto" "github.com/pion/sdp/v3" "github.com/pion/webrtc/v3" ) diff --git a/pkg/rtc/mediaengine_test.go b/pkg/rtc/mediaengine_test.go index 26b1b81ac..5682ee117 100644 --- a/pkg/rtc/mediaengine_test.go +++ b/pkg/rtc/mediaengine_test.go @@ -3,7 +3,7 @@ package rtc import ( "testing" - livekit "github.com/livekit/livekit-server/proto" + livekit "github.com/livekit/protocol/proto" "github.com/pion/webrtc/v3" "github.com/stretchr/testify/require" ) diff --git a/pkg/rtc/mediatrack.go b/pkg/rtc/mediatrack.go index b75eb6d50..ef29bae0b 100644 --- a/pkg/rtc/mediatrack.go +++ b/pkg/rtc/mediatrack.go @@ -6,6 +6,7 @@ import ( "sync/atomic" "time" + livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/utils" "github.com/pion/ion-sfu/pkg/buffer" "github.com/pion/ion-sfu/pkg/sfu" @@ -18,7 +19,6 @@ import ( "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/rtc/types" "github.com/livekit/livekit-server/pkg/utils/stats" - livekit "github.com/livekit/livekit-server/proto" ) var ( diff --git a/pkg/rtc/participant.go b/pkg/rtc/participant.go index f2268187d..b16967150 100644 --- a/pkg/rtc/participant.go +++ b/pkg/rtc/participant.go @@ -7,6 +7,8 @@ import ( "sync/atomic" "time" + livekit "github.com/livekit/protocol/proto" + "github.com/livekit/protocol/utils" "github.com/pion/ion-sfu/pkg/sfu" "github.com/pion/ion-sfu/pkg/twcc" "github.com/pion/rtcp" @@ -14,14 +16,11 @@ import ( "github.com/pkg/errors" "google.golang.org/protobuf/proto" - "github.com/livekit/protocol/utils" - "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/rtc/types" "github.com/livekit/livekit-server/pkg/utils/stats" - livekit "github.com/livekit/livekit-server/proto" "github.com/livekit/livekit-server/version" ) diff --git a/pkg/rtc/participant_internal_test.go b/pkg/rtc/participant_internal_test.go index 44bdd3a53..5e62abc33 100644 --- a/pkg/rtc/participant_internal_test.go +++ b/pkg/rtc/participant_internal_test.go @@ -4,6 +4,7 @@ import ( "testing" "time" + livekit "github.com/livekit/protocol/proto" "github.com/pion/webrtc/v3" "github.com/stretchr/testify/require" @@ -12,7 +13,6 @@ 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" - livekit "github.com/livekit/livekit-server/proto" ) func TestIsReady(t *testing.T) { diff --git a/pkg/rtc/room.go b/pkg/rtc/room.go index 6a520405d..d4c6c187f 100644 --- a/pkg/rtc/room.go +++ b/pkg/rtc/room.go @@ -7,6 +7,7 @@ import ( "sync/atomic" "time" + livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/utils" "github.com/pion/ion-sfu/pkg/buffer" "google.golang.org/protobuf/proto" @@ -15,7 +16,6 @@ import ( "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/rtc/types" "github.com/livekit/livekit-server/pkg/utils/stats" - livekit "github.com/livekit/livekit-server/proto" ) const ( diff --git a/pkg/rtc/room_test.go b/pkg/rtc/room_test.go index 11a0a37ba..d1f22f4a1 100644 --- a/pkg/rtc/room_test.go +++ b/pkg/rtc/room_test.go @@ -5,16 +5,15 @@ import ( "testing" "time" + livekit "github.com/livekit/protocol/proto" "github.com/stretchr/testify/require" "github.com/livekit/livekit-server/pkg/config" - "github.com/livekit/livekit-server/pkg/testutils" - "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/rtc" "github.com/livekit/livekit-server/pkg/rtc/types" "github.com/livekit/livekit-server/pkg/rtc/types/typesfakes" - livekit "github.com/livekit/livekit-server/proto" + "github.com/livekit/livekit-server/pkg/testutils" ) const ( diff --git a/pkg/rtc/subscribedtrack.go b/pkg/rtc/subscribedtrack.go index 7c7a51c1b..ec9b2364a 100644 --- a/pkg/rtc/subscribedtrack.go +++ b/pkg/rtc/subscribedtrack.go @@ -4,11 +4,10 @@ import ( "time" "github.com/bep/debounce" + livekit "github.com/livekit/protocol/proto" + "github.com/livekit/protocol/utils" "github.com/pion/ion-sfu/pkg/sfu" "github.com/pion/webrtc/v3" - - livekit "github.com/livekit/livekit-server/proto" - "github.com/livekit/protocol/utils" ) const ( diff --git a/pkg/rtc/transport.go b/pkg/rtc/transport.go index e7988e7a3..4889c5a5f 100644 --- a/pkg/rtc/transport.go +++ b/pkg/rtc/transport.go @@ -5,13 +5,12 @@ import ( "time" "github.com/bep/debounce" + livekit "github.com/livekit/protocol/proto" "github.com/pion/interceptor" "github.com/pion/webrtc/v3" "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/utils/stats" - - livekit "github.com/livekit/livekit-server/proto" ) const ( diff --git a/pkg/rtc/transport_test.go b/pkg/rtc/transport_test.go index 7d836d02b..e5c5821b8 100644 --- a/pkg/rtc/transport_test.go +++ b/pkg/rtc/transport_test.go @@ -5,11 +5,11 @@ import ( "testing" "time" + livekit "github.com/livekit/protocol/proto" "github.com/pion/webrtc/v3" "github.com/stretchr/testify/require" "github.com/livekit/livekit-server/pkg/testutils" - livekit "github.com/livekit/livekit-server/proto" ) func TestMissingAnswerDuringICERestart(t *testing.T) { diff --git a/pkg/rtc/types/interfaces.go b/pkg/rtc/types/interfaces.go index c8e9274b8..bfdc6ed2f 100644 --- a/pkg/rtc/types/interfaces.go +++ b/pkg/rtc/types/interfaces.go @@ -8,7 +8,7 @@ import ( "github.com/pion/webrtc/v3" "github.com/livekit/livekit-server/pkg/routing" - livekit "github.com/livekit/livekit-server/proto" + livekit "github.com/livekit/protocol/proto" ) //go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate diff --git a/pkg/rtc/types/typesfakes/fake_participant.go b/pkg/rtc/types/typesfakes/fake_participant.go index cb7989c55..55a7d6038 100644 --- a/pkg/rtc/types/typesfakes/fake_participant.go +++ b/pkg/rtc/types/typesfakes/fake_participant.go @@ -7,7 +7,7 @@ import ( "github.com/livekit/livekit-server/pkg/routing" "github.com/livekit/livekit-server/pkg/rtc/types" - livekit "github.com/livekit/livekit-server/proto" + livekit "github.com/livekit/protocol/proto" "github.com/pion/rtcp" webrtc "github.com/pion/webrtc/v3" ) diff --git a/pkg/rtc/types/typesfakes/fake_published_track.go b/pkg/rtc/types/typesfakes/fake_published_track.go index 0db086599..01891ec58 100644 --- a/pkg/rtc/types/typesfakes/fake_published_track.go +++ b/pkg/rtc/types/typesfakes/fake_published_track.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/livekit/livekit-server/pkg/rtc/types" - livekit "github.com/livekit/livekit-server/proto" + livekit "github.com/livekit/protocol/proto" ) type FakePublishedTrack struct { diff --git a/pkg/rtc/types/typesfakes/fake_subscribed_track.go b/pkg/rtc/types/typesfakes/fake_subscribed_track.go index a251fb555..69dbc584a 100644 --- a/pkg/rtc/types/typesfakes/fake_subscribed_track.go +++ b/pkg/rtc/types/typesfakes/fake_subscribed_track.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/livekit/livekit-server/pkg/rtc/types" - livekit "github.com/livekit/livekit-server/proto" + livekit "github.com/livekit/protocol/proto" "github.com/pion/ion-sfu/pkg/sfu" ) diff --git a/pkg/rtc/utils.go b/pkg/rtc/utils.go index b3f678e2c..447e9affc 100644 --- a/pkg/rtc/utils.go +++ b/pkg/rtc/utils.go @@ -6,11 +6,11 @@ import ( "io" "strings" + livekit "github.com/livekit/protocol/proto" "github.com/pion/webrtc/v3" "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/rtc/types" - livekit "github.com/livekit/livekit-server/proto" ) const ( diff --git a/pkg/service/localroomstore.go b/pkg/service/localroomstore.go index cb9f8ba1f..7ccc19cc8 100644 --- a/pkg/service/localroomstore.go +++ b/pkg/service/localroomstore.go @@ -4,7 +4,7 @@ import ( "sync" "time" - livekit "github.com/livekit/livekit-server/proto" + livekit "github.com/livekit/protocol/proto" ) // encapsulates CRUD operations for room settings diff --git a/pkg/service/recordingservice.go b/pkg/service/recordingservice.go index 77fc571b7..ae1b181f9 100644 --- a/pkg/service/recordingservice.go +++ b/pkg/service/recordingservice.go @@ -6,10 +6,9 @@ import ( "time" "github.com/go-redis/redis/v8" + livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/utils" "google.golang.org/protobuf/proto" - - livekit "github.com/livekit/livekit-server/proto" ) type RecordingService struct { diff --git a/pkg/service/redisroomstore.go b/pkg/service/redisroomstore.go index 3951d8dff..d8c0f2846 100644 --- a/pkg/service/redisroomstore.go +++ b/pkg/service/redisroomstore.go @@ -5,11 +5,10 @@ import ( "time" "github.com/go-redis/redis/v8" + livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/utils" "github.com/pkg/errors" "google.golang.org/protobuf/proto" - - livekit "github.com/livekit/livekit-server/proto" ) const ( diff --git a/pkg/service/redisroomstore_test.go b/pkg/service/redisroomstore_test.go index 233686ced..0c02678b9 100644 --- a/pkg/service/redisroomstore_test.go +++ b/pkg/service/redisroomstore_test.go @@ -6,10 +6,10 @@ import ( "testing" "time" + livekit "github.com/livekit/protocol/proto" "github.com/stretchr/testify/require" "github.com/livekit/livekit-server/pkg/service" - livekit "github.com/livekit/livekit-server/proto" ) func TestParticipantPersistence(t *testing.T) { diff --git a/pkg/service/roommanager.go b/pkg/service/roommanager.go index 4c67baa87..8f90537ed 100644 --- a/pkg/service/roommanager.go +++ b/pkg/service/roommanager.go @@ -6,6 +6,7 @@ import ( "time" "github.com/gammazero/workerpool" + livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/utils" "github.com/livekit/protocol/webhook" "github.com/pion/webrtc/v3" @@ -15,7 +16,6 @@ import ( "github.com/livekit/livekit-server/pkg/routing" "github.com/livekit/livekit-server/pkg/rtc" "github.com/livekit/livekit-server/pkg/rtc/types" - livekit "github.com/livekit/livekit-server/proto" ) const ( diff --git a/pkg/service/roommanager_test.go b/pkg/service/roommanager_test.go index 6b70d25fd..951144067 100644 --- a/pkg/service/roommanager_test.go +++ b/pkg/service/roommanager_test.go @@ -3,13 +3,14 @@ package service_test import ( "testing" + livekit "github.com/livekit/protocol/proto" + "github.com/stretchr/testify/require" + "github.com/livekit/livekit-server/pkg/config" "github.com/livekit/livekit-server/pkg/routing" "github.com/livekit/livekit-server/pkg/routing/routingfakes" "github.com/livekit/livekit-server/pkg/service" "github.com/livekit/livekit-server/pkg/service/servicefakes" - livekit "github.com/livekit/livekit-server/proto" - "github.com/stretchr/testify/require" ) func TestCreateRoom(t *testing.T) { diff --git a/pkg/service/roomservice.go b/pkg/service/roomservice.go index 1c3c669bc..64997e094 100644 --- a/pkg/service/roomservice.go +++ b/pkg/service/roomservice.go @@ -3,12 +3,12 @@ package service import ( "context" + livekit "github.com/livekit/protocol/proto" "github.com/pkg/errors" "github.com/thoas/go-funk" "github.com/twitchtv/twirp" "github.com/livekit/livekit-server/pkg/routing" - livekit "github.com/livekit/livekit-server/proto" ) // A rooms service that supports a single node diff --git a/pkg/service/roomstore.go b/pkg/service/roomstore.go index 41dc3f146..80838fe77 100644 --- a/pkg/service/roomstore.go +++ b/pkg/service/roomstore.go @@ -3,7 +3,7 @@ package service import ( "time" - livekit "github.com/livekit/livekit-server/proto" + livekit "github.com/livekit/protocol/proto" ) //go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate diff --git a/pkg/service/rtcservice.go b/pkg/service/rtcservice.go index bd111a201..9fa393057 100644 --- a/pkg/service/rtcservice.go +++ b/pkg/service/rtcservice.go @@ -8,13 +8,13 @@ import ( "strings" "github.com/gorilla/websocket" + livekit "github.com/livekit/protocol/proto" "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/rtc" "github.com/livekit/livekit-server/pkg/rtc/types" - livekit "github.com/livekit/livekit-server/proto" ) type RTCService struct { diff --git a/pkg/service/server.go b/pkg/service/server.go index 2738e9665..b98e9f60f 100644 --- a/pkg/service/server.go +++ b/pkg/service/server.go @@ -10,17 +10,16 @@ import ( "runtime/pprof" "time" + "github.com/livekit/protocol/auth" + livekit "github.com/livekit/protocol/proto" + "github.com/livekit/protocol/utils" "github.com/pion/turn/v2" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/urfave/negroni" - "github.com/livekit/protocol/auth" - "github.com/livekit/protocol/utils" - "github.com/livekit/livekit-server/pkg/config" "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/routing" - livekit "github.com/livekit/livekit-server/proto" "github.com/livekit/livekit-server/version" ) diff --git a/pkg/service/servicefakes/fake_room_store.go b/pkg/service/servicefakes/fake_room_store.go index 0ad87d894..33fb7c4a5 100644 --- a/pkg/service/servicefakes/fake_room_store.go +++ b/pkg/service/servicefakes/fake_room_store.go @@ -6,7 +6,7 @@ import ( "time" "github.com/livekit/livekit-server/pkg/service" - livekit "github.com/livekit/livekit-server/proto" + livekit "github.com/livekit/protocol/proto" ) type FakeRoomStore struct { diff --git a/pkg/service/utils.go b/pkg/service/utils.go index 50bce50f1..7c821471f 100644 --- a/pkg/service/utils.go +++ b/pkg/service/utils.go @@ -8,13 +8,13 @@ import ( "github.com/go-redis/redis/v8" "github.com/google/wire" "github.com/livekit/protocol/auth" + livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/webhook" "github.com/pkg/errors" "github.com/livekit/livekit-server/pkg/config" "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/routing" - livekit "github.com/livekit/livekit-server/proto" ) var ServiceSet = wire.NewSet( diff --git a/pkg/service/wire_gen.go b/pkg/service/wire_gen.go index aefb9190e..d5d3122f1 100644 --- a/pkg/service/wire_gen.go +++ b/pkg/service/wire_gen.go @@ -1,8 +1,7 @@ // Code generated by Wire. DO NOT EDIT. //go:generate go run github.com/google/wire/cmd/wire -//go:build !wireinject -// +build !wireinject +//+build !wireinject package service diff --git a/pkg/service/wsprotocol.go b/pkg/service/wsprotocol.go index 8f6ae3af1..ebf524887 100644 --- a/pkg/service/wsprotocol.go +++ b/pkg/service/wsprotocol.go @@ -5,12 +5,12 @@ import ( "time" "github.com/gorilla/websocket" + livekit "github.com/livekit/protocol/proto" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/proto" "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/rtc/types" - livekit "github.com/livekit/livekit-server/proto" ) const ( diff --git a/pkg/utils/stats/packetstats.go b/pkg/utils/stats/packetstats.go index e4601d261..3dd3106e9 100644 --- a/pkg/utils/stats/packetstats.go +++ b/pkg/utils/stats/packetstats.go @@ -3,7 +3,7 @@ package stats import ( "sync/atomic" - livekit "github.com/livekit/livekit-server/proto" + livekit "github.com/livekit/protocol/proto" "github.com/pion/rtcp" "github.com/prometheus/client_golang/prometheus" ) diff --git a/pkg/utils/stats/roomstatsreporter.go b/pkg/utils/stats/roomstatsreporter.go index 6018bab13..a416a6193 100644 --- a/pkg/utils/stats/roomstatsreporter.go +++ b/pkg/utils/stats/roomstatsreporter.go @@ -4,7 +4,7 @@ import ( "sync/atomic" "time" - livekit "github.com/livekit/livekit-server/proto" + livekit "github.com/livekit/protocol/proto" "github.com/prometheus/client_golang/prometheus" ) diff --git a/pkg/utils/stats/stats.go b/pkg/utils/stats/stats.go index a0430c672..a212b201c 100644 --- a/pkg/utils/stats/stats.go +++ b/pkg/utils/stats/stats.go @@ -5,7 +5,7 @@ import ( "time" linuxproc "github.com/c9s/goprocinfo/linux" - livekit "github.com/livekit/livekit-server/proto" + livekit "github.com/livekit/protocol/proto" "github.com/pion/interceptor" "github.com/pion/rtcp" "github.com/pion/rtp" diff --git a/test/client/client.go b/test/client/client.go index b272a2741..363ee4187 100644 --- a/test/client/client.go +++ b/test/client/client.go @@ -12,6 +12,8 @@ import ( "time" "github.com/gorilla/websocket" + livekit "github.com/livekit/protocol/proto" + "github.com/livekit/protocol/utils" "github.com/pion/rtcp" "github.com/pion/rtp" "github.com/pion/webrtc/v3" @@ -21,8 +23,6 @@ import ( "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/rtc" - livekit "github.com/livekit/livekit-server/proto" - "github.com/livekit/protocol/utils" ) type RTCClient struct { diff --git a/test/integration_helpers.go b/test/integration_helpers.go index c4baaea69..1bc2ca923 100644 --- a/test/integration_helpers.go +++ b/test/integration_helpers.go @@ -10,6 +10,7 @@ import ( "github.com/go-redis/redis/v8" "github.com/livekit/protocol/auth" + livekit "github.com/livekit/protocol/proto" "github.com/livekit/protocol/utils" "github.com/twitchtv/twirp" @@ -18,7 +19,6 @@ import ( "github.com/livekit/livekit-server/pkg/routing" "github.com/livekit/livekit-server/pkg/service" "github.com/livekit/livekit-server/pkg/testutils" - livekit "github.com/livekit/livekit-server/proto" testclient "github.com/livekit/livekit-server/test/client" ) diff --git a/test/multinode_test.go b/test/multinode_test.go index ad91c4d8b..6a3fbdd6d 100644 --- a/test/multinode_test.go +++ b/test/multinode_test.go @@ -4,9 +4,10 @@ import ( "testing" "time" - "github.com/livekit/livekit-server/pkg/testutils" - livekit "github.com/livekit/livekit-server/proto" + livekit "github.com/livekit/protocol/proto" "github.com/stretchr/testify/require" + + "github.com/livekit/livekit-server/pkg/testutils" ) func TestMultiNodeRouting(t *testing.T) { diff --git a/test/turn_test.go b/test/turn_test.go index ba1c78f2a..f6ab1ae30 100644 --- a/test/turn_test.go +++ b/test/turn_test.go @@ -6,15 +6,14 @@ import ( "testing" "time" + livekit "github.com/livekit/protocol/proto" + "github.com/livekit/protocol/utils" "github.com/pion/turn/v2" "github.com/stretchr/testify/require" - "github.com/livekit/protocol/utils" - "github.com/livekit/livekit-server/pkg/config" "github.com/livekit/livekit-server/pkg/routing" "github.com/livekit/livekit-server/pkg/service" - livekit "github.com/livekit/livekit-server/proto" ) func testTurnServer(t *testing.T) { diff --git a/test/webhook_test.go b/test/webhook_test.go index d6524e37d..53e7a694c 100644 --- a/test/webhook_test.go +++ b/test/webhook_test.go @@ -8,17 +8,18 @@ import ( "sync" "testing" + "github.com/livekit/protocol/auth" + livekit "github.com/livekit/protocol/proto" + "github.com/livekit/protocol/utils" + "github.com/livekit/protocol/webhook" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/encoding/protojson" + "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/testutils" - livekit "github.com/livekit/livekit-server/proto" - "github.com/livekit/protocol/auth" - "github.com/livekit/protocol/utils" - "github.com/livekit/protocol/webhook" - "github.com/stretchr/testify/require" - "google.golang.org/protobuf/encoding/protojson" ) func TestWebhooks(t *testing.T) { diff --git a/tools/tools.go b/tools/tools.go index 2fcffa217..102931637 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -5,6 +5,4 @@ package tools import ( _ "github.com/google/wire/cmd/wire" _ "github.com/maxbrunsfeld/counterfeiter/v6" - _ "github.com/twitchtv/twirp/protoc-gen-twirp" - _ "google.golang.org/protobuf/cmd/protoc-gen-go" )