我正在记录API。 API包括通过websocket连接发送具有特定格式的JSON数据。下面是一个例子。
我的问题是,有没有办法让每个这样的消息类型作为Sphinx中可以链接的对象,就像我对类或函数一样,比如
:py:func:`json.dumps`
会自动为我生成链接吗?
The client must be able to handle all of these sorts of messages.
It should fail gracefully without making any changes if the format of the data is not correct.
display_message
Display a message string to the user::
'data' : {'message' : 'Message text'}
game_list
Sends a list of games that the logged in user is participating in.
The client should display this, get the user to choose one and then respond with a *choose_game* message.::
'data' : {
'id' : 'white'
'id' : 'black' ...}
set_square_piece
This is the main message for dealing with the board::
'data' : {
'piece_colour' : str, #must be either 'white' or 'black'
'square_name' : str, #from 'a1' to 'h8'
'piece_type' : str, # e.g 'queen'
}