forked from cherry-game/cherry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ryansu
committed
Jun 17, 2021
1 parent
ed03d9b
commit bd60b11
Showing
11 changed files
with
319 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
module github.com/cherry-game/cherry | ||
|
||
go 1.15 | ||
|
||
require ( | ||
github.com/ahmetb/go-linq/v3 v3.2.0 // indirect | ||
github.com/gin-gonic/gin v1.6.3 | ||
github.com/golang/protobuf v1.3.3 | ||
github.com/gorilla/websocket v1.4.2 | ||
github.com/json-iterator/go v1.1.10 | ||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
github.com/modern-go/reflect2 v1.0.1 // indirect | ||
github.com/radovskyb/watcher v1.0.7 | ||
go.uber.org/multierr v1.6.0 // indirect | ||
go.uber.org/zap v1.16.0 | ||
gopkg.in/natefinch/lumberjack.v2 v2.0.0 | ||
gorm.io/driver/mysql v1.0.2 | ||
gorm.io/gorm v1.20.5 | ||
) | ||
module github.com/cherry-game/cherry | ||
|
||
go 1.15 | ||
|
||
require ( | ||
github.com/ahmetb/go-linq/v3 v3.2.0 // indirect | ||
github.com/gin-gonic/gin v1.6.3 | ||
github.com/golang/protobuf v1.5.2 | ||
github.com/gorilla/websocket v1.4.2 | ||
github.com/json-iterator/go v1.1.10 | ||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
github.com/modern-go/reflect2 v1.0.1 // indirect | ||
github.com/radovskyb/watcher v1.0.7 | ||
go.uber.org/multierr v1.6.0 // indirect | ||
go.uber.org/zap v1.16.0 | ||
google.golang.org/grpc v1.38.0 // indirect | ||
gopkg.in/natefinch/lumberjack.v2 v2.0.0 | ||
gorm.io/driver/mysql v1.0.2 | ||
gorm.io/gorm v1.20.5 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package cherryAgent | ||
|
||
import cherryFacade "github.com/cherry-game/cherry/facade" | ||
|
||
type AgentRemote struct { | ||
sid cherryFacade.SID | ||
gateClient interface{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,7 @@ type ClusterComponent struct { | |
//node discovery | ||
|
||
} | ||
|
||
func a() { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
protoc --go_out=plugins=grpc:../ --go_opt=paths=source_relative cluster.proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
syntax = "proto3"; | ||
|
||
option go_package = "/cherryCluster"; | ||
|
||
package cherryCluster; | ||
|
||
message NodeId { | ||
string id = 1; | ||
} | ||
|
||
message NodeInfo { | ||
string id = 1; | ||
string nodeType = 2; | ||
string address = 3; | ||
} | ||
|
||
message NodeList { | ||
repeated NodeInfo nodesInfo = 1; | ||
} | ||
|
||
message Response { | ||
} | ||
|
||
//service MasterNode { | ||
// rpc Register(NodeInfo) returns(NodeList) {} | ||
// rpc Unregister(NodeId) returns(Response) {} | ||
//} | ||
|
||
message ForwardMessage { | ||
int32 type = 1; | ||
string nodeId = 2; | ||
int64 sid = 3; | ||
uint64 id = 4; | ||
string route = 5; | ||
bytes data = 6; | ||
} | ||
|
||
message SessionId { | ||
int64 sid = 1; | ||
} | ||
|
||
service MemberNode { | ||
rpc Forward(ForwardMessage) returns (Response) {} | ||
rpc CloseSession(SessionId) returns (Response) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,4 @@ | ||
package cherryCluster | ||
|
||
import ( | ||
"github.com/cherry-game/cherry/facade" | ||
) | ||
|
||
type RPCServer struct { | ||
} | ||
|
||
func (*RPCServer) All() cherryFacade.NodeMap { | ||
return nil | ||
} | ||
|
||
func (*RPCServer) GetType(nodeId string) (nodeType string, err error) { | ||
return "", nil | ||
} | ||
|
||
func (*RPCServer) Get(nodeId string) cherryFacade.INode { | ||
return nil | ||
} | ||
|
||
func (*RPCServer) Sync() { | ||
|
||
} | ||
|
||
func (*RPCServer) AddListener(listener cherryFacade.INodeListener) { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package cherryCluster | ||
package cherryNode | ||
|
||
import ( | ||
"fmt" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters