Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1500eaf
temp commit
zhengzhiren Oct 22, 2014
b2d9620
change the json format with device center
zhengzhiren Oct 22, 2014
99a8be4
create zookeeper node
zhengzhiren Oct 22, 2014
d5fa083
finish zk producer and watcher
zhengzhiren Oct 22, 2014
3627204
remove zk.go
zhengzhiren Oct 22, 2014
a3133e9
Merge pull request #1 from zhengzhiren/zookeeper
zhengzhiren Oct 22, 2014
eeed32c
add API
zhengzhiren Oct 23, 2014
0d1f923
production config
zhengzhiren Oct 24, 2014
81e9097
add log
zhengzhiren Oct 24, 2014
ca5b340
Merge branch 'master' of https://github.com/chenyf/gibbon
zhengzhiren Oct 24, 2014
11267ab
REST api
zhengzhiren Oct 24, 2014
a70f0e2
control API
zhengzhiren Oct 27, 2014
101a728
create compatible_api.go
zhengzhiren Oct 27, 2014
dc82d33
update
zhengzhiren Oct 29, 2014
121f65f
change heartbeat_timeout to 240
zhengzhiren Oct 29, 2014
8b3a6d1
modify server read
zhengzhiren Oct 29, 2014
b41c58a
Merge branch 'master' of https://github.com/chenyf/gibbon
zhengzhiren Oct 29, 2014
5b8ad57
compatible API status code
zhengzhiren Oct 29, 2014
6050b92
remove reply channel when command timeout
zhengzhiren Oct 30, 2014
f439004
update
zhengzhiren Oct 30, 2014
9a58e9e
make agent work well
zhengzhiren Oct 31, 2014
46c623c
error code; log; ...
zhengzhiren Oct 31, 2014
9007ba2
check auth for new API
zhengzhiren Nov 4, 2014
1fb7fc5
sign for old APIs
zhengzhiren Nov 5, 2014
ba56276
move files
zhengzhiren Nov 5, 2014
760063b
fix checkAuthz
zhengzhiren Nov 6, 2014
336cab7
sign
zhengzhiren Nov 10, 2014
f6e47e9
update API
zhengzhiren Nov 18, 2014
f4af554
remove API
zhengzhiren Dec 2, 2014
74bef1a
save device Id to storage
zhengzhiren Dec 3, 2014
aa2dd87
add custom log format
zhengzhiren Dec 4, 2014
f4de1f6
up
zhengzhiren Dec 11, 2014
62458f0
fix bug in handleRpcRequest
zhengzhiren Dec 11, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
all: clean init gibbon tarball
all: clean init gibbon agent tarball

agent:
cd gibbonagent; GOOS=linux GOARCH=arm go build -o agent; go build -o agent.amd64

init:
mkdir -p output
Expand All @@ -11,12 +14,16 @@ gibbon:
# cd gibbonapi && go build

tarball: init gibbon
cp control.sh output
cp -r etc output
cp gibbond/control.sh output
mkdir -p output/etc
cp gibbond/etc/conf_product.json output/etc/conf.json
cp gibbond/etc/log.xml output/etc/log.xml
cp gibbond/etc/supervisord.conf output/etc/
cp misc/setupenv.sh output
tar -czf gibbon.tgz output

clean:
go clean
rm -rf gibbon gibbon.tgz output

rm -f test/test
rm -f gibbonagent/agent gibbonagent/agent.amd64
262 changes: 0 additions & 262 deletions api/gibbonapi.go

This file was deleted.

16 changes: 16 additions & 0 deletions cloud/def.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package cloud

const (
ERR_NOERROR = 10000
ERR_CMD_TIMEOUT = 20000
)

type ApiStatus struct {
ErrNo int `json:"errno"`
ErrMsg string `json:"errmsg,omitempty"`
}

type ApiResponse struct {
ApiStatus
Data interface{} `json:"data,omitempty"`
}
38 changes: 23 additions & 15 deletions comet/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ const (
)

const (
MSG_HEARTBEAT = uint8(0)
MSG_REGISTER = uint8(1)
MSG_REGISTER_REPLY = uint8(2)
MSG_REQUEST = uint8(3)
MSG_REQUEST_REPLY = uint8(4)
MSG_ROUTER_COMMAND = uint8(10)
MSG_ROUTER_COMMAND_REPLY = uint8(11)
MSG_HEARTBEAT = uint8(0)
MSG_REGISTER = uint8(1)
MSG_REGISTER_REPLY = uint8(2)
MSG_ROUTER_COMMAND = uint8(3)
MSG_ROUTER_COMMAND_REPLY = uint8(4)

// MSG_REQUEST = uint8(3)
// MSG_REQUEST_REPLY = uint8(4)
)

// msg to byte
Expand All @@ -54,18 +55,25 @@ type RegisterMessage struct {
}

type RegisterReplyMessage struct {
HeartbeatInterval int `json:"bt_interval"`
}

type CommandRequest struct {
Uid string `json:"uid"`
Cmd string `json:"cmd"`
}

type RouterCommandMessage struct {
Uid string `json:"uid"`
Cmd struct {
Forward string `json:"forward"`
} `json:"cmd"`
Uid string `json:"uid"`
Cmd string `json:"cmd"`
}

type RouterCommandReplyMessage struct {
Status int `json:"status"`
Descr string `json:"descr"`
Result string `json:"result"`
type RouterCommand struct {
Forward string `json:"forward"`
}

type RouterCommandReplyMessage struct {
Status int `json:"status"`
Descr string `json:"descr"`
Result string `json:"result"`
}
Loading