Skip to content

Commit

Permalink
Bump pitaya to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Felippe Durán committed Aug 28, 2020
1 parent 76b4e41 commit 9335b98
Show file tree
Hide file tree
Showing 154 changed files with 651 additions and 651 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,19 @@ test-coverage-func coverage-func: test-coverage merge-profiles
@go tool cover -func=coverage-all.out | egrep -v "100.0[%]"

agent-mock:
@mockgen github.com/topfreegames/pitaya/agent Agent,AgentFactory | sed 's/mock_agent/mocks/' > agent/mocks/agent.go
@mockgen github.com/topfreegames/pitaya/v2/agent Agent,AgentFactory | sed 's/mock_agent/mocks/' > agent/mocks/agent.go

session-mock:
@mockgen github.com/topfreegames/pitaya/session Session,SessionPool | sed 's/mock_session/mocks/' > session/mocks/session.go
@mockgen github.com/topfreegames/pitaya/v2/session Session,SessionPool | sed 's/mock_session/mocks/' > session/mocks/session.go

networkentity-mock:
@mockgen github.com/topfreegames/pitaya/networkentity NetworkEntity | sed 's/mock_networkentity/mocks/' > networkentity/mocks/networkentity.go
@mockgen github.com/topfreegames/pitaya/v2/networkentity NetworkEntity | sed 's/mock_networkentity/mocks/' > networkentity/mocks/networkentity.go

pitaya-mock:
@mockgen github.com/topfreegames/pitaya Pitaya | sed 's/mock_pitaya/mocks/' > mocks/app.go
@mockgen github.com/topfreegames/pitaya/v2 Pitaya | sed 's/mock_pitaya/mocks/' > mocks/app.go

serializer-mock:
@mockgen github.com/topfreegames/pitaya/serialize Serializer | sed 's/mock_serialize/mocks/' > serialize/mocks/serializer.go
@mockgen github.com/topfreegames/pitaya/v2/serialize Serializer | sed 's/mock_serialize/mocks/' > serialize/mocks/serializer.go

acceptor-mock:
@mockgen github.com/topfreegames/pitaya/acceptor Acceptor | sed 's/mock_acceptor/mocks/' > mocks/acceptor.go
@mockgen github.com/topfreegames/pitaya/v2/acceptor Acceptor | sed 's/mock_acceptor/mocks/' > mocks/acceptor.go
6 changes: 3 additions & 3 deletions acceptor/tcp_acceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (
"io/ioutil"
"net"

"github.com/topfreegames/pitaya/conn/codec"
"github.com/topfreegames/pitaya/constants"
"github.com/topfreegames/pitaya/logger"
"github.com/topfreegames/pitaya/v2/conn/codec"
"github.com/topfreegames/pitaya/v2/constants"
"github.com/topfreegames/pitaya/v2/logger"
)

// TCPAcceptor struct
Expand Down
6 changes: 3 additions & 3 deletions acceptor/tcp_acceptor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (
"time"

"github.com/stretchr/testify/assert"
"github.com/topfreegames/pitaya/conn/packet"
"github.com/topfreegames/pitaya/constants"
"github.com/topfreegames/pitaya/helpers"
"github.com/topfreegames/pitaya/v2/conn/packet"
"github.com/topfreegames/pitaya/v2/constants"
"github.com/topfreegames/pitaya/v2/helpers"
)

var tcpAcceptorTables = []struct {
Expand Down
8 changes: 4 additions & 4 deletions acceptor/ws_acceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import (
"time"

"github.com/gorilla/websocket"
"github.com/topfreegames/pitaya/conn/codec"
"github.com/topfreegames/pitaya/conn/packet"
"github.com/topfreegames/pitaya/constants"
"github.com/topfreegames/pitaya/logger"
"github.com/topfreegames/pitaya/v2/conn/codec"
"github.com/topfreegames/pitaya/v2/conn/packet"
"github.com/topfreegames/pitaya/v2/constants"
"github.com/topfreegames/pitaya/v2/logger"
)

// WSAcceptor struct
Expand Down
6 changes: 3 additions & 3 deletions acceptor/ws_acceptor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (

"github.com/gorilla/websocket"
"github.com/stretchr/testify/assert"
"github.com/topfreegames/pitaya/conn/packet"
"github.com/topfreegames/pitaya/constants"
"github.com/topfreegames/pitaya/helpers"
"github.com/topfreegames/pitaya/v2/conn/packet"
"github.com/topfreegames/pitaya/v2/constants"
"github.com/topfreegames/pitaya/v2/helpers"
)

var wsAcceptorTables = []struct {
Expand Down
2 changes: 1 addition & 1 deletion acceptorwrapper/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
package acceptorwrapper

import (
"github.com/topfreegames/pitaya/acceptor"
"github.com/topfreegames/pitaya/v2/acceptor"
)

// BaseWrapper implements Wrapper by saving the acceptor as an attribute.
Expand Down
4 changes: 2 additions & 2 deletions acceptorwrapper/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ package acceptorwrapper
import (
"testing"

"github.com/topfreegames/pitaya/acceptor"
"github.com/topfreegames/pitaya/v2/acceptor"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"github.com/topfreegames/pitaya/mocks"
"github.com/topfreegames/pitaya/v2/mocks"
)

func TestListenAndServe(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions acceptorwrapper/rate_limiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import (
"container/list"
"time"

"github.com/topfreegames/pitaya"
"github.com/topfreegames/pitaya/acceptor"
"github.com/topfreegames/pitaya/constants"
"github.com/topfreegames/pitaya/logger"
"github.com/topfreegames/pitaya/metrics"
"github.com/topfreegames/pitaya/v2"
"github.com/topfreegames/pitaya/v2/acceptor"
"github.com/topfreegames/pitaya/v2/constants"
"github.com/topfreegames/pitaya/v2/logger"
"github.com/topfreegames/pitaya/v2/metrics"
)

// RateLimiter wraps net.Conn by applying rate limiting and return empty
Expand Down
4 changes: 2 additions & 2 deletions acceptorwrapper/rate_limiter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"github.com/topfreegames/pitaya/metrics"
"github.com/topfreegames/pitaya/mocks"
"github.com/topfreegames/pitaya/v2/metrics"
"github.com/topfreegames/pitaya/v2/mocks"
)

func TestRateLimiterGetNextMessage(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions acceptorwrapper/rate_limiting_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
package acceptorwrapper

import (
"github.com/topfreegames/pitaya"
"github.com/topfreegames/pitaya/acceptor"
"github.com/topfreegames/pitaya/config"
"github.com/topfreegames/pitaya/v2"
"github.com/topfreegames/pitaya/v2/acceptor"
"github.com/topfreegames/pitaya/v2/config"
)

// RateLimitingWrapper rate limits for each connection
Expand Down
6 changes: 3 additions & 3 deletions acceptorwrapper/rate_limiting_wrapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import (
"github.com/golang/mock/gomock"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
"github.com/topfreegames/pitaya/config"
"github.com/topfreegames/pitaya/metrics"
"github.com/topfreegames/pitaya/mocks"
"github.com/topfreegames/pitaya/v2/config"
"github.com/topfreegames/pitaya/v2/metrics"
"github.com/topfreegames/pitaya/v2/mocks"
)

func TestNewRateLimitingWrapper(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion acceptorwrapper/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
package acceptorwrapper

import (
"github.com/topfreegames/pitaya/acceptor"
"github.com/topfreegames/pitaya/v2/acceptor"
)

// Wrapper has a method that receives an acceptor and the struct
Expand Down
26 changes: 13 additions & 13 deletions agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ import (
"sync/atomic"
"time"

"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/errors"
"github.com/topfreegames/pitaya/logger"
"github.com/topfreegames/pitaya/metrics"
"github.com/topfreegames/pitaya/protos"
"github.com/topfreegames/pitaya/serialize"
"github.com/topfreegames/pitaya/session"
"github.com/topfreegames/pitaya/tracing"
"github.com/topfreegames/pitaya/util"
"github.com/topfreegames/pitaya/util/compression"
"github.com/topfreegames/pitaya/v2/conn/codec"
"github.com/topfreegames/pitaya/v2/conn/message"
"github.com/topfreegames/pitaya/v2/conn/packet"
"github.com/topfreegames/pitaya/v2/constants"
"github.com/topfreegames/pitaya/v2/errors"
"github.com/topfreegames/pitaya/v2/logger"
"github.com/topfreegames/pitaya/v2/metrics"
"github.com/topfreegames/pitaya/v2/protos"
"github.com/topfreegames/pitaya/v2/serialize"
"github.com/topfreegames/pitaya/v2/session"
"github.com/topfreegames/pitaya/v2/tracing"
"github.com/topfreegames/pitaya/v2/util"
"github.com/topfreegames/pitaya/v2/util/compression"

opentracing "github.com/opentracing/opentracing-go"
)
Expand Down
22 changes: 11 additions & 11 deletions agent/agent_remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ import (
"reflect"

"github.com/golang/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/logger"
"github.com/topfreegames/pitaya/protos"
"github.com/topfreegames/pitaya/route"
"github.com/topfreegames/pitaya/serialize"
"github.com/topfreegames/pitaya/session"
"github.com/topfreegames/pitaya/util"
"github.com/topfreegames/pitaya/v2/cluster"
"github.com/topfreegames/pitaya/v2/conn/codec"
"github.com/topfreegames/pitaya/v2/conn/message"
"github.com/topfreegames/pitaya/v2/conn/packet"
"github.com/topfreegames/pitaya/v2/constants"
"github.com/topfreegames/pitaya/v2/logger"
"github.com/topfreegames/pitaya/v2/protos"
"github.com/topfreegames/pitaya/v2/route"
"github.com/topfreegames/pitaya/v2/serialize"
"github.com/topfreegames/pitaya/v2/session"
"github.com/topfreegames/pitaya/v2/util"
)

// Remote corresponding to another server
Expand Down
22 changes: 11 additions & 11 deletions agent/agent_remote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ import (
"github.com/golang/mock/gomock"
"github.com/google/uuid"
"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"
"github.com/topfreegames/pitaya/protos"
"github.com/topfreegames/pitaya/route"
serializemocks "github.com/topfreegames/pitaya/serialize/mocks"
"github.com/topfreegames/pitaya/session"
"github.com/topfreegames/pitaya/v2/cluster"
clustermocks "github.com/topfreegames/pitaya/v2/cluster/mocks"
codecmocks "github.com/topfreegames/pitaya/v2/conn/codec/mocks"
"github.com/topfreegames/pitaya/v2/conn/message"
messagemocks "github.com/topfreegames/pitaya/v2/conn/message/mocks"
"github.com/topfreegames/pitaya/v2/conn/packet"
"github.com/topfreegames/pitaya/v2/constants"
"github.com/topfreegames/pitaya/v2/protos"
"github.com/topfreegames/pitaya/v2/route"
serializemocks "github.com/topfreegames/pitaya/v2/serialize/mocks"
"github.com/topfreegames/pitaya/v2/session"
)

type someStruct struct {
Expand Down
28 changes: 14 additions & 14 deletions agent/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ 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"
"github.com/topfreegames/pitaya/metrics"
metricsmocks "github.com/topfreegames/pitaya/metrics/mocks"
"github.com/topfreegames/pitaya/mocks"
"github.com/topfreegames/pitaya/protos"
serializemocks "github.com/topfreegames/pitaya/serialize/mocks"
"github.com/topfreegames/pitaya/session"
codecmocks "github.com/topfreegames/pitaya/v2/conn/codec/mocks"
"github.com/topfreegames/pitaya/v2/conn/message"
messagemocks "github.com/topfreegames/pitaya/v2/conn/message/mocks"
"github.com/topfreegames/pitaya/v2/conn/packet"
"github.com/topfreegames/pitaya/v2/constants"
pcontext "github.com/topfreegames/pitaya/v2/context"
e "github.com/topfreegames/pitaya/v2/errors"
"github.com/topfreegames/pitaya/v2/helpers"
"github.com/topfreegames/pitaya/v2/metrics"
metricsmocks "github.com/topfreegames/pitaya/v2/metrics/mocks"
"github.com/topfreegames/pitaya/v2/mocks"
"github.com/topfreegames/pitaya/v2/protos"
serializemocks "github.com/topfreegames/pitaya/v2/serialize/mocks"
"github.com/topfreegames/pitaya/v2/session"
)

type mockAddr struct{}
Expand Down
8 changes: 4 additions & 4 deletions agent/mocks/agent.go

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

44 changes: 22 additions & 22 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,28 @@ import (
"github.com/golang/protobuf/proto"
opentracing "github.com/opentracing/opentracing-go"
"github.com/spf13/viper"
"github.com/topfreegames/pitaya/acceptor"
"github.com/topfreegames/pitaya/cluster"
"github.com/topfreegames/pitaya/component"
"github.com/topfreegames/pitaya/config"
"github.com/topfreegames/pitaya/conn/message"
"github.com/topfreegames/pitaya/constants"
pcontext "github.com/topfreegames/pitaya/context"
"github.com/topfreegames/pitaya/docgenerator"
"github.com/topfreegames/pitaya/errors"
"github.com/topfreegames/pitaya/groups"
"github.com/topfreegames/pitaya/interfaces"
"github.com/topfreegames/pitaya/logger"
"github.com/topfreegames/pitaya/metrics"
mods "github.com/topfreegames/pitaya/modules"
"github.com/topfreegames/pitaya/remote"
"github.com/topfreegames/pitaya/router"
"github.com/topfreegames/pitaya/serialize"
"github.com/topfreegames/pitaya/service"
"github.com/topfreegames/pitaya/session"
"github.com/topfreegames/pitaya/timer"
"github.com/topfreegames/pitaya/tracing"
"github.com/topfreegames/pitaya/worker"
"github.com/topfreegames/pitaya/v2/acceptor"
"github.com/topfreegames/pitaya/v2/cluster"
"github.com/topfreegames/pitaya/v2/component"
"github.com/topfreegames/pitaya/v2/config"
"github.com/topfreegames/pitaya/v2/conn/message"
"github.com/topfreegames/pitaya/v2/constants"
pcontext "github.com/topfreegames/pitaya/v2/context"
"github.com/topfreegames/pitaya/v2/docgenerator"
"github.com/topfreegames/pitaya/v2/errors"
"github.com/topfreegames/pitaya/v2/groups"
"github.com/topfreegames/pitaya/v2/interfaces"
"github.com/topfreegames/pitaya/v2/logger"
"github.com/topfreegames/pitaya/v2/metrics"
mods "github.com/topfreegames/pitaya/v2/modules"
"github.com/topfreegames/pitaya/v2/remote"
"github.com/topfreegames/pitaya/v2/router"
"github.com/topfreegames/pitaya/v2/serialize"
"github.com/topfreegames/pitaya/v2/service"
"github.com/topfreegames/pitaya/v2/session"
"github.com/topfreegames/pitaya/v2/timer"
"github.com/topfreegames/pitaya/v2/tracing"
"github.com/topfreegames/pitaya/v2/worker"
)

// ServerMode represents a server mode
Expand Down
24 changes: 12 additions & 12 deletions app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ import (
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
"github.com/topfreegames/pitaya/acceptor"
"github.com/topfreegames/pitaya/cluster"
"github.com/topfreegames/pitaya/config"
"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/logger"
"github.com/topfreegames/pitaya/route"
"github.com/topfreegames/pitaya/router"
"github.com/topfreegames/pitaya/session/mocks"
"github.com/topfreegames/pitaya/timer"
"github.com/topfreegames/pitaya/v2/acceptor"
"github.com/topfreegames/pitaya/v2/cluster"
"github.com/topfreegames/pitaya/v2/config"
"github.com/topfreegames/pitaya/v2/conn/message"
"github.com/topfreegames/pitaya/v2/constants"
e "github.com/topfreegames/pitaya/v2/errors"
"github.com/topfreegames/pitaya/v2/helpers"
"github.com/topfreegames/pitaya/v2/logger"
"github.com/topfreegames/pitaya/v2/route"
"github.com/topfreegames/pitaya/v2/router"
"github.com/topfreegames/pitaya/v2/session/mocks"
"github.com/topfreegames/pitaya/v2/timer"
)

var (
Expand Down
Loading

0 comments on commit 9335b98

Please sign in to comment.