lando 0.2.1

Rust http interface for AWS lambda API gateway events
lando-0.2.1 doesn't have any documentation.
Lando provides building blocks for serverless HTTP Rust applications deployable on [AWS Lambda](https://aws.amazon.com/lambda/). Specifically, lando exposes [API Gateway](https://aws.amazon.com/api-gateway/) proxy events as standard Rust [http](https://crates.io/crates/http) types with API Gateway modeled [Bodies](enum.Body.html). For convenience, `lando` re-exports `http::Request` and `http::Response`. AWS Lambda is a ✨ **fully managed** ✨ compute service allowing you to run code without thinking about servers. AWS will provide [monitoring metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-functions.html) and [scaling](https://docs.aws.amazon.com/lambda/latest/dg/scaling.html) out of the box for you. Lando exports Rust functions as native CPython modules making it possible to embed handlers within AWS' [Python3.6 runtime](https://docs.aws.amazon.com/lambda/latest/dg/python-programming-model.html). # Usage Add `lando` to your `Cargo.toml` ```toml [dependencies] lando = "0.2" ``` Within your application's source, use lando's macros. ``` #[macro_use] extern crate lando; # fn main() { } ``` Write your function using the [gateway!](macro.gateway.html) macro. See it's documentation for more examples. ```rust # #[macro_use] extern crate lando; gateway!(|_request, context| { println!("👋 cloudwatch logs, this is {}", context.function_name()); // return a basic 200 response Ok(()) }); # fn main() { } ``` Alternatively, you can also just attribute a bare handler `fn` with `#[lando]` ```rust # #[macro_use] extern crate lando; use lando::{Request, LambdaContext, IntoResponse, Result}; #[lando] fn handler( _: Request, _: LambdaContext ) -> Result { Ok(()) } ``` # Packaging functions Lando targets AWS Lambda's Python3.6 runtime. The [gateway!](macro.gateway.html) macro does the all the integration for you, but cargo still needs to know what type of `lib` you are compiling. Cargo makes it easy to produce compatible binaries. Simply add the following setting to your crate's `Cargo.toml` file. ```toml [lib] crate-type = ["cdylib"] ``` 💡 `cdylib` produces dynamic library embeddable in other languages. This and other link formats are described [here](https://doc.rust-lang.org/reference/linkage.html) `cargo build` will then produce an AWS deploy-ready `liblambda.so` binary artifact on linux hosts. Package this file in a zip file and it's now deployable as an AWS Lambda function! Be sure to use the the Python 3.6 execution environment with the handler configured as `lib{your_crate_name}.handler`. Because you're building a dynamic library, other libraries that you're dynamically linking against need to also be in the Lambda execution environment. The easiest way to achive this is by building in an environment similar to Lambda's. [This Docker container](https://hub.docker.com/r/softprops/lambda-rust/) faithfully reproduces the AWS Lambda Python 3.6 runtime.