Commit Graph

16 Commits

Author SHA1 Message Date
Denis Makogon
7dd9b5a4cd We still can write JSON request object in parts
except just copying content from request body to STDIN
  we need to write encoded data,
  so we're using STDIN JSON stream encoder.
2017-10-07 00:43:09 +03:00
Denis Makogon
588d9e523b Do not forget to close request body 2017-10-07 00:43:09 +03:00
Denis Makogon
c2ee67fb21 Revisiting request body processing 2017-10-07 00:43:09 +03:00
Denis Makogon
1f589d641e Let function write headers to a response 2017-10-07 00:43:09 +03:00
Denis Makogon
caf1488dd9 Make Dispatch cleaner 2017-10-07 00:43:09 +03:00
Denis Makogon
2250e1d08c Get rid of content-length-based copying 2017-10-07 00:43:08 +03:00
Denis Makogon
1cdd241920 Trying to avoid buffers and write directly to pipe
this change makes Dispatch write request body and
 http headers directly to pipe one by one
 in case of non-empty request body,
 if not - write headers and close finalize JSON
2017-10-07 00:43:08 +03:00
Denis Makogon
955b294bc6 Trying to avoid any buffering 2017-10-07 00:43:08 +03:00
Denis Makogon
da9629d8dc Use STDIN as writer for encoding func's JSON input data instead of buffering 2017-10-07 00:43:08 +03:00
Denis Makogon
0316cd90a1 Dismiss redundant function 2017-10-07 00:43:08 +03:00
Denis Makogon
3fb040f293 Addressing comments
What's new?
  - unmarshal JSON response only in case of HTTP response writer
2017-10-07 00:43:07 +03:00
Denis Makogon
783490dc79 Addressing certain comments
What's new?
 - better error handling
 - still need to decode JSON from function because we need status code and body
 - prevent request body to be a problem by deferring its close
 - moving examples around: putting http and json samples into one folder
2017-10-07 00:43:07 +03:00
Denis Makogon
1882845a61 Respond with any error that happends during JSON dispatching 2017-10-07 00:43:07 +03:00
Denis Makogon
3da9ad4328 Using io.LimitReader as the way to control size of request body with respect to content length 2017-10-07 00:43:07 +03:00
Denis Makogon
ecaa5eefbf Cleaning up code
Getting rid of request url, call id, method: all of them are
 redundant and available through env
2017-10-07 00:43:07 +03:00
amykang2020
b6b9b55ca9 apply/make Travis's json-format branch prototype to work with latest restructured master; added StatusCode to JSONOutput server-function contract 2017-10-07 00:43:07 +03:00