Permalink
Browse files

documented various directives including the new rds_json_format.

  • Loading branch information...
1 parent 2e15cde commit e41118ea486f1ebdcbbfe3847083efb948fafd6b @agentzh agentzh committed Nov 18, 2010
Showing with 50 additions and 0 deletions.
  1. +50 −0 README
View
@@ -36,6 +36,56 @@ Description
This module provides an output filter that can format the RDS outputs
generated by ngx_drizzle and ngx_postgres modules.
+Directives
+ rds_json
+ syntax: rds_json on|off
+ default: rds_json off
+
+ Enables or disables the output filter of this module.
+
+ rds_json_buffer_size
+ syntax: rds_json_buffer_size <bytes>
+ default: rds_json_buffer_size <page-size>
+
+ Controls the buffer size used by this module. default to the page size (4k/8k).
+ The bigger the buffer size, the less streammy the conversion
+ will be. But usually increasing the buffer size
+ does help reduce CPU time.
+
+ rds_json_format
+ syntax: rds_json_format normal|compact
+ default: rds_json_format normal
+
+ Controls the output JSON format. A sample of the default "normal" format
+ looks like this
+
+ [{"id":1,"name":"marry"},{"id":2,"name":"bob"}]
+
+ while it looks like below when in the "compact" format
+
+ [["id","name"],[1,"marry"],[2,"bob"]]
+
+ that is, the first row holds the column name list.
+
+ rds_json_ret
+ syntax: rds_json_ret <error-code> <descrption>
+ default: none
+
+ This directive enables a content handler that simply emits
+ an response body like this:
+
+ {"errcode":<error-code>,"errstr":"<description>"}
+
+ while the <description> string will be properly quoted as
+ a JSON string.
+
+ rds_json_content_type
+ syntax: rds_json_content_type <mime-type>
+ default: rds_json_content_type application/json
+
+ Controls the Content-Type header of the response generated by
+ this module's output filter.
+
Installation
Grab the nginx source code from nginx.net (<http://nginx.net/>), for
example, the version 0.8.36 (see nginx compatibility), and then build

0 comments on commit e41118e

Please sign in to comment.