mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-01 13:10:43 +00:00
Remove old docs, rename docs_new to docs
It would be probably good idea to also remove tools/docgen.py and asciidoc.mk, but asciidoc.mk is still mentioned under `cloud/doc`, which may contain some useful info which we'll need at least to review before removing. PUBLISHED_FROM=faf454d4c52a2f07ea8ac084cf0bd11a0c9c9b3b
This commit is contained in:
1 parent
f443c64341
commit
23122b327c
182 files changed
+3592
-263
No files matched your search
@@ -0,0 +1,8 @@
|
||||
---
|
||||
title: "JSON-RPC"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "json-rpc.h"
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"items": [
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "intro.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_rpc_parse_reply.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_rpc_create_request.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_rpc_create_reply.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_rpc_create_error.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_rpc_create_std_error.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "mg_rpc_dispatch.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "struct_mg_rpc_request.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "struct_mg_rpc_reply.md"
|
||||
},
|
||||
{
|
||||
"type": "markdown",
|
||||
"name": "struct_mg_rpc_error.md"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "mg_rpc_create_error()"
|
||||
decl_name: "mg_rpc_create_error"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_rpc_create_error(char *buf, int len, struct mg_rpc_request *req,
|
||||
int code, const char *message, const char *fmt, ...);
|
||||
---
|
||||
|
||||
Create JSON-RPC error reply in a given buffer.
|
||||
|
||||
Return length of the error, which
|
||||
can be larger then `len` that indicates an overflow.
|
||||
`fmt` format string should conform to `json_emit()` API,
|
||||
see https://github.com/cesanta/frozen
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "mg_rpc_create_reply()"
|
||||
decl_name: "mg_rpc_create_reply"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_rpc_create_reply(char *buf, int len, const struct mg_rpc_request *req,
|
||||
const char *result_fmt, ...);
|
||||
---
|
||||
|
||||
Create JSON-RPC reply in a given buffer.
|
||||
|
||||
Return length of the reply, which
|
||||
can be larger then `len` that indicates an overflow.
|
||||
`result_fmt` format string should conform to `json_emit()` API,
|
||||
see https://github.com/cesanta/frozen
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "mg_rpc_create_request()"
|
||||
decl_name: "mg_rpc_create_request"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_rpc_create_request(char *buf, int len, const char *method,
|
||||
const char *id, const char *params_fmt, ...);
|
||||
---
|
||||
|
||||
Create JSON-RPC request in a given buffer.
|
||||
|
||||
Return length of the request, which
|
||||
can be larger then `len` that indicates an overflow.
|
||||
`params_fmt` format string should conform to `json_emit()` API,
|
||||
see https://github.com/cesanta/frozen
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
title: "mg_rpc_create_std_error()"
|
||||
decl_name: "mg_rpc_create_std_error"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_rpc_create_std_error(char *buf, int len, struct mg_rpc_request *req,
|
||||
int code);
|
||||
---
|
||||
|
||||
Create JSON-RPC error in a given buffer.
|
||||
|
||||
Return length of the error, which
|
||||
can be larger then `len` that indicates an overflow. See
|
||||
JSON_RPC_*_ERROR definitions for standard error values:
|
||||
|
||||
- `#define JSON_RPC_PARSE_ERROR (-32700)`
|
||||
- `#define JSON_RPC_INVALID_REQUEST_ERROR (-32600)`
|
||||
- `#define JSON_RPC_METHOD_NOT_FOUND_ERROR (-32601)`
|
||||
- `#define JSON_RPC_INVALID_PARAMS_ERROR (-32602)`
|
||||
- `#define JSON_RPC_INTERNAL_ERROR (-32603)`
|
||||
- `#define JSON_RPC_SERVER_ERROR (-32000)`
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
title: "mg_rpc_dispatch()"
|
||||
decl_name: "mg_rpc_dispatch"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_rpc_dispatch(const char *buf, int, char *dst, int dst_len,
|
||||
const char **methods, mg_rpc_handler_t *handlers);
|
||||
---
|
||||
|
||||
Dispatches a JSON-RPC request.
|
||||
|
||||
Parses JSON-RPC request contained in `buf`, `len`.
|
||||
Then, dispatches the request to the correct handler method.
|
||||
Valid method names should be specified in NULL
|
||||
terminated array `methods`, and corresponding handlers in `handlers`.
|
||||
Result is put in `dst`, `dst_len`. Return: length of the result, which
|
||||
can be larger then `dst_len` that indicates an overflow.
|
||||
Overflown bytes are not written to the buffer.
|
||||
If method is not found, an error is automatically generated.
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
title: "mg_rpc_parse_reply()"
|
||||
decl_name: "mg_rpc_parse_reply"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_rpc_parse_reply(const char *buf, int len, struct json_token *toks,
|
||||
int max_toks, struct mg_rpc_reply *,
|
||||
struct mg_rpc_error *);
|
||||
---
|
||||
|
||||
Parse JSON-RPC reply contained in `buf`, `len` into JSON tokens array
|
||||
`toks`, `max_toks`. If buffer contains valid reply, `reply` structure is
|
||||
populated. The result of RPC call is located in `reply.result`. On error,
|
||||
`error` structure is populated. Returns: the result of calling
|
||||
`parse_json(buf, len, toks, max_toks)`:
|
||||
|
||||
On success, an offset inside `json_string` is returned
|
||||
where parsing has finished. On failure, a negative number is
|
||||
returned, one of:
|
||||
|
||||
- `#define JSON_STRING_INVALID -1`
|
||||
- `#define JSON_STRING_INCOMPLETE -2`
|
||||
- `#define JSON_TOKEN_ARRAY_TOO_SMALL -3`
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "struct mg_rpc_error"
|
||||
decl_name: "struct mg_rpc_error"
|
||||
symbol_kind: "struct"
|
||||
signature: |
|
||||
struct mg_rpc_error {
|
||||
struct json_token *message; /* Whole RPC message */
|
||||
struct json_token *id; /* Message ID */
|
||||
struct json_token *error_code; /* error.code */
|
||||
struct json_token *error_message; /* error.message */
|
||||
struct json_token *error_data; /* error.data, can be NULL */
|
||||
};
|
||||
---
|
||||
|
||||
JSON-RPC error
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
title: "struct mg_rpc_reply"
|
||||
decl_name: "struct mg_rpc_reply"
|
||||
symbol_kind: "struct"
|
||||
signature: |
|
||||
struct mg_rpc_reply {
|
||||
struct json_token *message; /* Whole RPC message */
|
||||
struct json_token *id; /* Message ID */
|
||||
struct json_token *result; /* Remote call result */
|
||||
};
|
||||
---
|
||||
|
||||
JSON-RPC response
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
title: "struct mg_rpc_request"
|
||||
decl_name: "struct mg_rpc_request"
|
||||
symbol_kind: "struct"
|
||||
signature: |
|
||||
struct mg_rpc_request {
|
||||
struct json_token *message; /* Whole RPC message */
|
||||
struct json_token *id; /* Message ID */
|
||||
struct json_token *method; /* Method name */
|
||||
struct json_token *params; /* Method params */
|
||||
};
|
||||
---
|
||||
|
||||
JSON-RPC request
|
||||
|
||||
Reference in new issue
Block a user