Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define input/output formats #11

Closed
2 tasks
rdallman opened this issue Jul 27, 2017 · 5 comments
Closed
2 tasks

Define input/output formats #11

rdallman opened this issue Jul 27, 2017 · 5 comments
Assignees

Comments

@rdallman
Copy link
Contributor

In gitlab by @treeder on May 11, 2017, 11:07

  • Further define inputs and outputs (how to set response status for example)
  • Put them all into the same doc, there are currently a few different docs (input/output, open function format, and writing functions). Merge those.

We can support various formats and essentially two modes: one time and streaming. One time executes a container once for each request and streaming enables "hot functions" so you can keep a container running and stream requests in.

All input is via STDIN, response output is via STDOUT and logging output is via STDERR.

We'll start with a couple of different formats:

  • "default" invoke once per request, body into STDIN + headers as ENV vars
    • what env vars are set?
    • what part of the request is passed in as ENV vars?
  • "http" hot function format
    • same basic set of env vars as default above
    • no per request env vars as they will be in the HTTP header

Default

Env vars

  • REQUEST_URL - the full URL for the request
  • ROUTE - the matched route, potentially different than the path in REQUEST_URL if dynamic route used
  • METHOD - the HTTP method for the request
  • HEADER_X - the HTTP headers for this request. Replace X with the upper cased name of the header and replace dashes in the header with underscores.
  • X - any configuration values you've set for the Application or the Route. Replace X with the upper cased name of the config variable you set. Ex: minio_secret=secret will be exposed via MINIO_SECRET env var

Input

Stream request body directly in.

Output

Output from STDOUT is returned to client. JSON content-type.

HTTP

Env vars

  • ROUTE - just the matching route? Everything else could change per request

Input

Exactly the same as the request?

Output

TODO: How to set content type? Can't do this with Lambda, but would be nice to offer this ability. Response when streaming could have a header section.

Other options

Perhaps an easier to parse format like json could be used.

@rdallman
Copy link
Contributor Author

In gitlab by @treeder on May 11, 2017, 21:25

assigned to @treeder

@rdallman
Copy link
Contributor Author

In gitlab by @rdallman on May 17, 2017, 16:47

this is mostly just clean up now?

@rdallman
Copy link
Contributor Author

In gitlab by @treeder on May 18, 2017, 10:42

Ya, I think so. I'm going to go through all the docs and examples actually and clean thing up. Lots of cruft.

@rdallman
Copy link
Contributor Author

In gitlab by @treeder on May 25, 2017, 13:31

closed

@rdallman
Copy link
Contributor Author

In gitlab by @treeder on May 25, 2017, 13:31

I attempted to do this, but there's too much stuff to go into one doc and decided it's maybe not the best to do this. !17 has some minor fixes though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants