mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 12:20:41 +00:00
use sproto instead of cjson
This commit is contained in:
37
examples/proto.lua
Normal file
37
examples/proto.lua
Normal file
@@ -0,0 +1,37 @@
|
||||
local sprotoparser = require "sprotoparser"
|
||||
|
||||
local proto = sprotoparser.parse [[
|
||||
.package {
|
||||
type 0 : integer
|
||||
session 1 : integer
|
||||
}
|
||||
|
||||
handshake 1 {
|
||||
request {}
|
||||
response {
|
||||
msg 0 : string
|
||||
}
|
||||
}
|
||||
|
||||
get 2 {
|
||||
request {
|
||||
what 0 : string
|
||||
}
|
||||
response {
|
||||
result 0 : boolean
|
||||
}
|
||||
}
|
||||
|
||||
set 3 {
|
||||
request {
|
||||
what 0 : string
|
||||
value 1 : string
|
||||
}
|
||||
response {
|
||||
ok 0 : boolean
|
||||
}
|
||||
}
|
||||
|
||||
]]
|
||||
|
||||
return proto
|
||||
Reference in New Issue
Block a user