Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upEvent struct definitions #12
Comments
This comment has been minimized.
This comment has been minimized.
|
Hey @LegNeato, thanks for offering. I'll talk this through with @davidbarsky once we get back from re:Invent. |
This comment has been minimized.
This comment has been minimized.
In the short term, we'd be very happy to re-export those types. Until we have a PR (whether from us or you—let us know; I won't be able to put one up today), we'll link to the lambda definitions in the README.md. In the long term, we'd like to take ownership of those definitions, but we'd need to weigh whether we want to generate from Go's definitions or our internal definitions. |
This comment has been minimized.
This comment has been minimized.
|
Great! I'm hopping on a plane right now so won't be able to get a PR up for the readme for a while. No rush! I agree long-term it would be ideal for you to generate the defs from your internal definitions rather than the go code. If there were public defs like |
This comment has been minimized.
This comment has been minimized.
Totally, travel safe :)
I'd need to chat with the right people internally. I suspect that there's a proper long-term solution available. |
davidbarsky
added this to the 0.2 milestone
Nov 29, 2018
sapessi
referenced this issue
Dec 1, 2018
Merged
introduce lambda-http module based on lando to support apigateway #18
This comment has been minimized.
This comment has been minimized.
|
Few ideas I wanted to throw out there because this same topic must be opened for each and every type checked language used in lambda in the past and likely every type checked language implemented in the future. Something I'd considered a few months back was kicking around the idea putting together a repository that collecting machine readable json schemas documenting and describing AWS lambda types. https://github.com/softprops/typed-lambda It's just an idea at this point and it's incomplete ( as you can see from it's Travis build :) ). The first attempt was to use a go package to read the go structs and output Json schemas that could in theory be used to regenerate the go and any other type checked language AWS lambda structures. In practice I found the go definitions to produce imprecise information. For instance in go, zero values (nil) are useful and don't translate information to a language like rust. My next exploration was going to be translating this via typescript types which express type information more precisely to Json schemas https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/aws-lambda/index.d.ts I wanted to drop a heads up in case you folks would be interested in collaborating to generate rust types from Json schemas as well. I see this kind of thing have a benefit to a wider audience as other language sdks would also benefit. |
This comment has been minimized.
This comment has been minimized.
|
Hey @softprops, I'll meet with the Lambda team next week to figure out what we have internally and could use for this. I'd try to rely on those definitions since they are the ones the Lambda team is likely to keep up to date for us. I'll update this issue once I have something. |
LegNeato commentedNov 29, 2018
•
edited
Hello! I am one of the maintainers of https://github.com/srijs/rust-aws-lambda (Rust interface to the Go runtime). As part of that project, we have lambda event definitions that don't depend on the runtime:
https://github.com/srijs/rust-aws-lambda/tree/master/aws_lambda_events
It would be great to have those event types integrated in this crate, preferably by re-exporting. I'm also fine if you want to take over ownership and make it officially supported, as long as it doesn't take too long for changes to be merged.
Note right now the generated structs take
Stringand thus may require more allocations. I plan to also have variants that takeCow<'a, str>.