Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

documented various directives including the new rds_json_format.

  • Loading branch information...
commit e41118ea486f1ebdcbbfe3847083efb948fafd6b 1 parent 2e15cde
Yichun Zhang authored November 18, 2010

Showing 1 changed file with 50 additions and 0 deletions. Show diff stats Hide diff stats

  1. 50  README
50  README
@@ -36,6 +36,56 @@ Description
36 36
     This module provides an output filter that can format the RDS outputs
37 37
     generated by ngx_drizzle and ngx_postgres modules.
38 38
 
  39
+Directives
  40
+    rds_json
  41
+        syntax: rds_json  on|off
  42
+        default: rds_json off
  43
+
  44
+        Enables or disables the output filter of this module.
  45
+
  46
+    rds_json_buffer_size
  47
+        syntax: rds_json_buffer_size   <bytes>
  48
+        default: rds_json_buffer_size <page-size>
  49
+
  50
+        Controls the buffer size used by this module. default to the page size (4k/8k).
  51
+        The bigger the buffer size, the less streammy the conversion
  52
+        will be. But usually increasing the buffer size
  53
+        does help reduce CPU time.
  54
+
  55
+    rds_json_format
  56
+        syntax: rds_json_format  normal|compact
  57
+        default: rds_json_format normal
  58
+
  59
+        Controls the output JSON format. A sample of the default "normal" format
  60
+        looks like this
  61
+
  62
+            [{"id":1,"name":"marry"},{"id":2,"name":"bob"}]
  63
+
  64
+        while it looks like below when in the "compact" format
  65
+
  66
+            [["id","name"],[1,"marry"],[2,"bob"]]
  67
+
  68
+        that is, the first row holds the column name list.
  69
+
  70
+    rds_json_ret
  71
+        syntax: rds_json_ret <error-code> <descrption>
  72
+        default: none
  73
+
  74
+        This directive enables a content handler that simply emits
  75
+        an response body like this:
  76
+
  77
+            {"errcode":<error-code>,"errstr":"<description>"}
  78
+
  79
+        while the <description> string will be properly quoted as
  80
+        a JSON string.
  81
+
  82
+    rds_json_content_type
  83
+        syntax: rds_json_content_type <mime-type>
  84
+        default: rds_json_content_type application/json
  85
+
  86
+        Controls the Content-Type header of the response generated by
  87
+        this module's output filter.
  88
+
39 89
 Installation
40 90
     Grab the nginx source code from nginx.net (<http://nginx.net/>), for
41 91
     example, the version 0.8.36 (see nginx compatibility), and then build

0 notes on commit e41118e

Please sign in to comment.
Something went wrong with that request. Please try again.