mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
example for sproto
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
local sprotoparser = require "sprotoparser"
|
||||
|
||||
local proto = sprotoparser.parse [[
|
||||
local proto = {}
|
||||
|
||||
proto.c2s = sprotoparser.parse [[
|
||||
.package {
|
||||
type 0 : integer
|
||||
session 1 : integer
|
||||
@@ -17,7 +19,7 @@ get 2 {
|
||||
what 0 : string
|
||||
}
|
||||
response {
|
||||
result 0 : boolean
|
||||
result 0 : string
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,11 +28,17 @@ set 3 {
|
||||
what 0 : string
|
||||
value 1 : string
|
||||
}
|
||||
response {
|
||||
ok 0 : boolean
|
||||
}
|
||||
}
|
||||
|
||||
]]
|
||||
|
||||
proto.s2c = sprotoparser.parse [[
|
||||
.package {
|
||||
type 0 : integer
|
||||
session 1 : integer
|
||||
}
|
||||
|
||||
heartbeat 1 {}
|
||||
]]
|
||||
|
||||
return proto
|
||||
|
||||
Reference in New Issue
Block a user