refactor - moved common code to livekit/protocol

This commit is contained in:
David Zhao
2021-03-13 22:01:51 -08:00
parent e20c831c14
commit 7d02c01fd8
79 changed files with 6771 additions and 1410 deletions
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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
View File
@@ -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 -2
View File
@@ -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 {
+2 -2
View File
@@ -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 (
+2 -2
View File
@@ -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 {
+1 -1
View File
@@ -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 {
+1 -2
View File
@@ -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
+1 -1
View File
@@ -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) {