All Versions
4
Latest Version
Avg Release Cycle
59 days
Latest Release
1969 days ago

Changelog History

  • v0.2.1 Changes

    November 28, 2018
    • ๐Ÿ›  fix version referenced in docs
  • v0.2.0 Changes

    November 28, 2018
    • ease dependency declartions by re-exporting http crate

    before

    ... in your Cargo.toml file

    [dependencies]
    lando = "0.1"
    http = "0.1" # need to depend on http crate explicitly
    

    ... in your src/lib.rs

    #[macro_use]
    extern crate lando;
    // need to extern http crate explicitly
    extern crate http;
    
    use http::{Method, StatusCode};
    

    after

    ... in your Cargo.toml

    [dependencies]
    lando = "0.2" # no longer need to add a dependency on http explicitly
    

    ... in your src/lib.rs

    #[macro_use]
    extern crate lando;
    
    // consume http re-export from lando crate
    use lando::http::{Method, StatusCode};
    
    • โœ‚ remove the need to explicitly declare cpython as a dependency, both as a depenency and macro_use

    before

    ... in your Cargo.toml file

    [dependencies]
    lando = "0.1"
    cpython = "0.1" # need to depend on cpython crate explicitly for its macros
    

    ... in your src/lib.rs file

    #[macro_use]
    extern crate lando;
    // needed because lando's macros used cpython macros,
    // an impl detail
    #[macro_use]
    extern crate cpython;
    

    after

    ... in your Cargo.toml file

    [dependencies]
    lando = "0.2" # no longer need to declar cpython as an explicit dependency
    

    ... in your src/lib.rs file

    #[macro_use]
    extern crate lando; // impl details are hidden
    
    • โฌ‡๏ธ reduced exposed surface area of internal interfaces

    lando::GatewayRequest still is still public (for benchmarking) but its fields are not

    • โฌ‡๏ธ reduced cost of transformations between lambda proxy types and rust native http crate types

    Replaced many owned String types with Cow. Now deserializing and serializing request headers and http method directly to http::HeaderMap and http::Method respectively

    • RequestExt methods now return a strmap::StrMap type instead of HashMap<String, String>
    • introducing IntoResponse trait

    ๐Ÿ– Handlers can now return anything that implements lando::IntoResponse. As a result lando::Result type now takes a type parameter as a placeholder those types. Implementations for lando::Response and types that implement Into<Body> are provided

    • introducing #[lando] proc macro.

    You can now attribute a bare function with #[lando] to have it exported

    use lando::{Request, LambdaContext, Result};
    
    #[lando]
    fn handler<'a>(_: Request, _: LambdaContext) -> Result<&'a str> {
      Ok("hello lando")
    }
    
  • v0.1.1 Changes

    June 06, 2018
    • ๐Ÿ› bug fix - support for reading host from "host" (lowercase) in addition to "Host"
    • ๐Ÿ”‹ feature - add support for "application/x-www-form-urlencoded" and "application/json" parsed request bodies with lando::RequestExt#payload()
    #[macro_use] extern crate cpython;
    #[macro_use] extern crate lando;
    #[macro_use] extern crate serde_deserialize;
    
    use lando::{Response, RequestEx};
    
    #[derive(Deserialize, Debug)]
    struct Params {
      x: usize,
      y: usize
    }
    
    gateway!(
      |req, _| => Ok(
        Response::new(
          req.payload::<Params>().unwrap_or_else(|_| None).map(
            |params| format!(
              "the answer is {}", params.x + params.y
            )
          ).unwrap_or_else(
            || "try again".to_string()
          )
        )
      )
    );
    
  • v0.1.0 Changes

    June 04, 2018
    • ๐ŸŽ‰ initial release