Skip to content

Commit 7676900

Browse files
committed
rename client package
1 parent e611be6 commit 7676900

File tree

8 files changed

+29
-29
lines changed

8 files changed

+29
-29
lines changed

candy.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/*
2-
3-
Candy是一款即时通信软件。
4-
5-
Gate 接收客户端请求,负责客户端连接维护
6-
Notice 消息分发中心,整个系统的消息队列
7-
Store 消息及用户信息存储
8-
9-
下载
10-
将 candy 代码 clone 到 $GOPATH/src/github.com/dearcode 目录下
11-
12-
编译安装
13-
make
14-
15-
运行
16-
依次启动 master, notice, store, gate, 直接运行不需要参数,默认使用9000到9004端口
2+
3+
Candy是一款即时通信软件。
4+
5+
Gate 接收客户端请求,负责客户端连接维护
6+
Notice 消息分发中心,整个系统的消息队列
7+
Store 消息及用户信息存储
8+
9+
下载
10+
将 candy 代码 clone 到 $GOPATH/src/github.com/dearcode 目录下
11+
12+
编译安装
13+
make
14+
15+
运行
16+
依次启动 master, notice, store, gate, 直接运行不需要参数,默认使用9000到9004端口
1717
1818
1919
技术讨论QQ群:29996599

client/candy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package candy
1+
package client
22

33
import (
44
"time"

client/candy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package candy
1+
package client
22

33
import (
44
"bytes"

client/client.aar

3.21 MB
Binary file not shown.

client/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package candy
1+
package client
22

33
// UserInfo 用户信息
44
type UserInfo struct {

client/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package candy
1+
package client
22

33
import (
44
"encoding/json"

cmd/master/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func main() {
1717
return
1818
}
1919

20-
s := master.NewMasterServer(*host)
20+
s := master.NewMaster(*host)
2121
if err := s.Start(); err != nil {
2222
println(err.Error())
2323
}

master/server.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ import (
1010
"github.com/dearcode/candy/util/log"
1111
)
1212

13-
// MasterServer process gate request.
14-
type MasterServer struct {
13+
// Master process gate request.
14+
type Master struct {
1515
host string
1616
idAllocator *idAllocator
1717
}
1818

19-
// NewMasterServer create new MasterServer
20-
func NewMasterServer(host string) *MasterServer {
21-
return &MasterServer{host: host, idAllocator: newIDAllocator()}
19+
// NewMaster create new Master.
20+
func NewMaster(host string) *Master {
21+
return &Master{host: host, idAllocator: newIDAllocator()}
2222
}
2323

24-
// Start start masterServer
25-
func (g *MasterServer) Start() error {
26-
log.Debugf("masterServer Start...")
24+
// Start start Master
25+
func (g *Master) Start() error {
26+
log.Debugf("Master Start...")
2727
serv := grpc.NewServer()
2828
meta.RegisterMasterServer(serv, g)
2929

@@ -36,6 +36,6 @@ func (g *MasterServer) Start() error {
3636
}
3737

3838
// NewID return an new id
39-
func (g *MasterServer) NewID(_ context.Context, _ *meta.NewIDRequest) (*meta.NewIDResponse, error) {
39+
func (g *Master) NewID(_ context.Context, _ *meta.NewIDRequest) (*meta.NewIDResponse, error) {
4040
return &meta.NewIDResponse{ID: g.idAllocator.newID()}, nil
4141
}

0 commit comments

Comments
 (0)