Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/cloudinterfaces/lh

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/cloudinterfaces/lh

  • v0.0.0-20180425172602-de17b8e569b1
  • Source
  • Go
  • Socket score

Version published
Created
Source

lh

A package to serve http.Handlers in the Amazon Lambda Go runtime. GoDoc

This is a replacement for the lambda package as published in the aws/aws-lambda-go repository. This package allows serving (many or most) http.Handlers.

Usage

Call lh.ServeHTTP(handler) from a main package. If handler is nil, http.DefaultServeMux will be served.

Deployment

The lago commandline tool is designed to make deploying Go handlers to Lambda about as easy as it can possibly be.

Notes

This package only works with API Gateway requests. Undefined behavior may occur if the Lambda function is called with other request types. API Gateway must be configured to treat all content types as binary (*/* is in "Binary Media Types" under the Settings tab). No notion of streaming or connections exists in the API Gateway/Lambda environment, therefore the ResponseWriter may not be asserted to http.Flusher nor http.Hijacker, the CONNECT method cannot be used in a useful way, and other behavior (like Expect headers) are handled upstream. Request and response size is limited by the Lambda environment; it's unlikely more than 10k of request headers, 6 megabytes of request body, or 10 megabytes of response will succeed. Finally, it's unreasonable to expect goroutines created from ServeHTTP methods to continue running indefinately after ServeHTTP exits; if something makes assumptions about long-running processes it's probably not a candidate for the Lambda environment.

That said, many packages that implement http.Handler should work fine. For example Gorilla's RPC works, and gin works OK when used as an http.Handler. Revel won't but you can't do most of the stuff it does in the Lambda environment anyway.

FAQs

Package last updated on 25 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc