Skip to content

Commit

Permalink
Message package be public (topfreegames#72)
Browse files Browse the repository at this point in the history
* Moved internal to conn folder

* Changed all the files to be able to find the new location of internal files
  • Loading branch information
rodrigolck authored and andrehp committed Nov 27, 2018
1 parent cf4f763 commit df946c6
Show file tree
Hide file tree
Showing 58 changed files with 68 additions and 68 deletions.
6 changes: 3 additions & 3 deletions agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ import (
"time"

opentracing "github.com/opentracing/opentracing-go"
"github.com/topfreegames/pitaya/conn/codec"
"github.com/topfreegames/pitaya/conn/message"
"github.com/topfreegames/pitaya/conn/packet"
"github.com/topfreegames/pitaya/constants"
"github.com/topfreegames/pitaya/internal/codec"
"github.com/topfreegames/pitaya/internal/message"
"github.com/topfreegames/pitaya/internal/packet"
"github.com/topfreegames/pitaya/logger"
"github.com/topfreegames/pitaya/metrics"
"github.com/topfreegames/pitaya/protos"
Expand Down
6 changes: 3 additions & 3 deletions agent/agent_remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import (

"github.com/gogo/protobuf/proto"
"github.com/topfreegames/pitaya/cluster"
"github.com/topfreegames/pitaya/conn/codec"
"github.com/topfreegames/pitaya/conn/message"
"github.com/topfreegames/pitaya/conn/packet"
"github.com/topfreegames/pitaya/constants"
"github.com/topfreegames/pitaya/internal/codec"
"github.com/topfreegames/pitaya/internal/message"
"github.com/topfreegames/pitaya/internal/packet"
"github.com/topfreegames/pitaya/logger"
"github.com/topfreegames/pitaya/protos"
"github.com/topfreegames/pitaya/route"
Expand Down
8 changes: 4 additions & 4 deletions agent/agent_remote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ import (
"github.com/stretchr/testify/assert"
"github.com/topfreegames/pitaya/cluster"
clustermocks "github.com/topfreegames/pitaya/cluster/mocks"
codecmocks "github.com/topfreegames/pitaya/conn/codec/mocks"
"github.com/topfreegames/pitaya/conn/message"
messagemocks "github.com/topfreegames/pitaya/conn/message/mocks"
"github.com/topfreegames/pitaya/conn/packet"
"github.com/topfreegames/pitaya/constants"
codecmocks "github.com/topfreegames/pitaya/internal/codec/mocks"
"github.com/topfreegames/pitaya/internal/message"
messagemocks "github.com/topfreegames/pitaya/internal/message/mocks"
"github.com/topfreegames/pitaya/internal/packet"
"github.com/topfreegames/pitaya/protos"
"github.com/topfreegames/pitaya/route"
serializemocks "github.com/topfreegames/pitaya/serialize/mocks"
Expand Down
8 changes: 4 additions & 4 deletions agent/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ import (
"github.com/golang/mock/gomock"
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
codecmocks "github.com/topfreegames/pitaya/conn/codec/mocks"
"github.com/topfreegames/pitaya/conn/message"
messagemocks "github.com/topfreegames/pitaya/conn/message/mocks"
"github.com/topfreegames/pitaya/conn/packet"
"github.com/topfreegames/pitaya/constants"
pcontext "github.com/topfreegames/pitaya/context"
e "github.com/topfreegames/pitaya/errors"
"github.com/topfreegames/pitaya/helpers"
codecmocks "github.com/topfreegames/pitaya/internal/codec/mocks"
"github.com/topfreegames/pitaya/internal/message"
messagemocks "github.com/topfreegames/pitaya/internal/message/mocks"
"github.com/topfreegames/pitaya/internal/packet"
"github.com/topfreegames/pitaya/metrics"
metricsmocks "github.com/topfreegames/pitaya/metrics/mocks"
"github.com/topfreegames/pitaya/mocks"
Expand Down
4 changes: 2 additions & 2 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ import (
"github.com/topfreegames/pitaya/cluster"
"github.com/topfreegames/pitaya/component"
"github.com/topfreegames/pitaya/config"
"github.com/topfreegames/pitaya/conn/codec"
"github.com/topfreegames/pitaya/conn/message"
"github.com/topfreegames/pitaya/constants"
pcontext "github.com/topfreegames/pitaya/context"
"github.com/topfreegames/pitaya/defaultpipelines"
"github.com/topfreegames/pitaya/docgenerator"
"github.com/topfreegames/pitaya/errors"
"github.com/topfreegames/pitaya/internal/codec"
"github.com/topfreegames/pitaya/internal/message"
"github.com/topfreegames/pitaya/logger"
"github.com/topfreegames/pitaya/metrics"
mods "github.com/topfreegames/pitaya/modules"
Expand Down
4 changes: 2 additions & 2 deletions app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ import (
"github.com/stretchr/testify/assert"
"github.com/topfreegames/pitaya/acceptor"
"github.com/topfreegames/pitaya/cluster"
"github.com/topfreegames/pitaya/conn/codec"
"github.com/topfreegames/pitaya/conn/message"
"github.com/topfreegames/pitaya/constants"
e "github.com/topfreegames/pitaya/errors"
"github.com/topfreegames/pitaya/helpers"
"github.com/topfreegames/pitaya/internal/codec"
"github.com/topfreegames/pitaya/internal/message"
"github.com/topfreegames/pitaya/logger"
"github.com/topfreegames/pitaya/metrics"
"github.com/topfreegames/pitaya/route"
Expand Down
6 changes: 3 additions & 3 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import (

"github.com/sirupsen/logrus"
"github.com/topfreegames/pitaya"
"github.com/topfreegames/pitaya/internal/codec"
"github.com/topfreegames/pitaya/internal/message"
"github.com/topfreegames/pitaya/internal/packet"
"github.com/topfreegames/pitaya/conn/codec"
"github.com/topfreegames/pitaya/conn/message"
"github.com/topfreegames/pitaya/conn/packet"
"github.com/topfreegames/pitaya/logger"
"github.com/topfreegames/pitaya/util/compression"
)
Expand Down
2 changes: 1 addition & 1 deletion client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"github.com/golang/mock/gomock"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/topfreegames/pitaya/conn/message"
"github.com/topfreegames/pitaya/helpers"
"github.com/topfreegames/pitaya/internal/message"
"github.com/topfreegames/pitaya/mocks"
)

Expand Down
2 changes: 1 addition & 1 deletion cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ package cluster
import (
"context"

"github.com/topfreegames/pitaya/conn/message"
"github.com/topfreegames/pitaya/constants"
pcontext "github.com/topfreegames/pitaya/context"
"github.com/topfreegames/pitaya/interfaces"
"github.com/topfreegames/pitaya/internal/message"
"github.com/topfreegames/pitaya/logger"
"github.com/topfreegames/pitaya/protos"
"github.com/topfreegames/pitaya/route"
Expand Down
2 changes: 1 addition & 1 deletion cluster/grpc_rpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import (

opentracing "github.com/opentracing/opentracing-go"
"github.com/topfreegames/pitaya/config"
"github.com/topfreegames/pitaya/conn/message"
"github.com/topfreegames/pitaya/constants"
pitErrors "github.com/topfreegames/pitaya/errors"
"github.com/topfreegames/pitaya/interfaces"
"github.com/topfreegames/pitaya/internal/message"
"github.com/topfreegames/pitaya/logger"
"github.com/topfreegames/pitaya/metrics"
"github.com/topfreegames/pitaya/protos"
Expand Down
14 changes: 7 additions & 7 deletions cluster/grpc_rpc_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
"github.com/topfreegames/pitaya/config"
"github.com/topfreegames/pitaya/conn/message"
"github.com/topfreegames/pitaya/constants"
"github.com/topfreegames/pitaya/helpers"
"github.com/topfreegames/pitaya/interfaces"
"github.com/topfreegames/pitaya/interfaces/mocks"
"github.com/topfreegames/pitaya/internal/message"
"github.com/topfreegames/pitaya/metrics"
"github.com/topfreegames/pitaya/protos"
protosmocks "github.com/topfreegames/pitaya/protos/mocks"
Expand Down Expand Up @@ -129,7 +129,7 @@ func TestSendKick(t *testing.T) {
mockPitayaClient := protosmocks.NewMockPitayaClient(ctrl)
tables := []struct {
name string
userId string
userID string
bindingStorage interfaces.BindingStorage
sv *Server
err error
Expand Down Expand Up @@ -157,22 +157,22 @@ func TestSendKick(t *testing.T) {
if table.bindingStorage != nil {
g.clientMap.Store(table.sv.ID, mockPitayaClient)
g.bindingStorage = table.bindingStorage
mockBindingStorage.EXPECT().GetUserFrontendID(table.userId, gomock.Any()).DoAndReturn(func(u, svType string) (string, error) {
assert.Equal(t, table.userId, u)
mockBindingStorage.EXPECT().GetUserFrontendID(table.userID, gomock.Any()).DoAndReturn(func(u, svType string) (string, error) {
assert.Equal(t, table.userID, u)
assert.Equal(t, table.sv.Type, svType)
return table.sv.ID, nil
})

mockPitayaClient.EXPECT().KickUser(gomock.Any(), gomock.Any()).Do(func(ctx context.Context, msg *protos.KickMsg) {
assert.Equal(t, table.userId, msg.UserId)
assert.Equal(t, table.userID, msg.UserId)
})
}

kick := &protos.KickMsg{
UserId: table.userId,
UserId: table.userID,
}

err = g.SendKick(table.userId, table.sv.Type, kick)
err = g.SendKick(table.userID, table.sv.Type, kick)
if table.err != nil {
assert.Equal(t, err, table.err)
} else {
Expand Down
2 changes: 1 addition & 1 deletion cluster/mocks/cluster.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cluster/nats_rpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import (
nats "github.com/nats-io/go-nats"
opentracing "github.com/opentracing/opentracing-go"
"github.com/topfreegames/pitaya/config"
"github.com/topfreegames/pitaya/conn/message"
"github.com/topfreegames/pitaya/constants"
"github.com/topfreegames/pitaya/errors"
"github.com/topfreegames/pitaya/internal/message"
"github.com/topfreegames/pitaya/logger"
"github.com/topfreegames/pitaya/metrics"
"github.com/topfreegames/pitaya/protos"
Expand Down
2 changes: 1 addition & 1 deletion cluster/nats_rpc_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ import (
nats "github.com/nats-io/go-nats"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
"github.com/topfreegames/pitaya/conn/message"
"github.com/topfreegames/pitaya/constants"
e "github.com/topfreegames/pitaya/errors"
"github.com/topfreegames/pitaya/helpers"
"github.com/topfreegames/pitaya/internal/message"
"github.com/topfreegames/pitaya/metrics"
metricsmocks "github.com/topfreegames/pitaya/metrics/mocks"
"github.com/topfreegames/pitaya/protos"
Expand Down
2 changes: 1 addition & 1 deletion component/method.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"unicode/utf8"

"github.com/gogo/protobuf/proto"
"github.com/topfreegames/pitaya/internal/message"
"github.com/topfreegames/pitaya/conn/message"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion component/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"errors"
"reflect"

"github.com/topfreegames/pitaya/conn/message"
"github.com/topfreegames/pitaya/constants"
"github.com/topfreegames/pitaya/internal/message"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion component/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/topfreegames/pitaya/conn/message"
"github.com/topfreegames/pitaya/constants"
"github.com/topfreegames/pitaya/internal/message"
)

type unexportedTestType struct {
Expand Down
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

package codec

import "github.com/topfreegames/pitaya/internal/packet"
import "github.com/topfreegames/pitaya/conn/packet"

// PacketDecoder interface
type PacketDecoder interface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

package codec

import "github.com/topfreegames/pitaya/internal/packet"
import "github.com/topfreegames/pitaya/conn/packet"

// PacketEncoder interface
type PacketEncoder interface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ package codec
import (
"bytes"

"github.com/topfreegames/pitaya/internal/packet"
"github.com/topfreegames/pitaya/conn/packet"
)

// PomeloPacketDecoder reads and decodes network data slice following pomelo's protocol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/topfreegames/pitaya/internal/packet"
"github.com/topfreegames/pitaya/conn/packet"
)

var forwardTables = map[string]struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
package codec

import (
"github.com/topfreegames/pitaya/internal/packet"
"github.com/topfreegames/pitaya/conn/packet"
)

// PomeloPacketEncoder struct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/topfreegames/pitaya/internal/packet"
"github.com/topfreegames/pitaya/conn/packet"
)

func helperConcatBytes(packetType packet.Type, length, data []byte) []byte {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import (
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/topfreegames/pitaya/client"
"github.com/topfreegames/pitaya/conn/message"
"github.com/topfreegames/pitaya/helpers"
"github.com/topfreegames/pitaya/internal/message"
)

var update = flag.Bool("update", false, "update server binary")
Expand Down
2 changes: 1 addition & 1 deletion router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"time"

"github.com/topfreegames/pitaya/cluster"
"github.com/topfreegames/pitaya/conn/message"
"github.com/topfreegames/pitaya/constants"
"github.com/topfreegames/pitaya/internal/message"
"github.com/topfreegames/pitaya/logger"
"github.com/topfreegames/pitaya/protos"
"github.com/topfreegames/pitaya/route"
Expand Down
2 changes: 1 addition & 1 deletion router/router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/topfreegames/pitaya/cluster"
"github.com/topfreegames/pitaya/cluster/mocks"
"github.com/topfreegames/pitaya/internal/message"
"github.com/topfreegames/pitaya/conn/message"
"github.com/topfreegames/pitaya/protos"
"github.com/topfreegames/pitaya/route"
)
Expand Down
4 changes: 2 additions & 2 deletions rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import (
"github.com/stretchr/testify/assert"
"github.com/topfreegames/pitaya/cluster"
clustermocks "github.com/topfreegames/pitaya/cluster/mocks"
"github.com/topfreegames/pitaya/conn/codec"
"github.com/topfreegames/pitaya/conn/message"
"github.com/topfreegames/pitaya/constants"
"github.com/topfreegames/pitaya/internal/codec"
"github.com/topfreegames/pitaya/internal/message"
"github.com/topfreegames/pitaya/protos"
"github.com/topfreegames/pitaya/protos/test"
"github.com/topfreegames/pitaya/route"
Expand Down
Loading

0 comments on commit df946c6

Please sign in to comment.