1#![doc = include_str!("../README.md")]
2#![warn(missing_docs)]
3
4use aws_lambda_events::apigw::ApiGatewayProxyResponse;
5
6pub use async_trait;
9pub use aws_lambda_events::apigw::ApiGatewayProxyRequestContext;
10pub use aws_lambda_events::encodings::Body;
11pub use aws_lambda_events::http::{HeaderMap, HeaderName};
12pub use http::{Response, StatusCode};
13pub use lambda_runtime::{Context as LambdaContext, LambdaEvent};
14
15pub mod error;
17
18pub use error::EventError;
19
20mod middleware;
21
22pub use middleware::{Middleware, UnauthenticatedMiddleware};
23
24pub mod models;
26
27mod runtime;
28
29pub use runtime::run_lambda;
30
31pub type HttpResponse = Response<Body>;
33
34pub fn http_response_to_apigw(response: HttpResponse) -> ApiGatewayProxyResponse {
36 let (parts, body) = response.into_parts();
37 ApiGatewayProxyResponse {
38 status_code: parts.status.as_u16() as i64,
39 headers: Default::default(),
40 multi_value_headers: parts.headers,
41 body: Some(body),
42 is_base64_encoded: false,
43 }
44}
45
46#[doc(hidden)]
50#[path = "private/mod.rs"]
51pub mod __private;