Added protocol module stub

This commit is contained in:
Jonatan Pålsson 2011-01-30 14:10:01 +01:00
parent 0881081d5c
commit 4965013fc9

16
src/ggs_protocol.erl Normal file
View file

@ -0,0 +1,16 @@
%% This is a parser for JSON implemented using mochijson2
%% Don't feed it anything other than valid JSON.
-module(ggs_protocol).
-export([parse/1]).
parse(JSONData) ->
{struct, Struct} = js_mochijson2:decode(JSONData),
RequestType = proplists:get_value(<<"request">>, Struct),
case RequestType of
<<"define">> ->
ok_you_said_define;
Other ->
io:format("~p", [RequestType]),
ok_i_dont_understand
end.