🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

github.com/pkosterman/aws-lambda-barcode-generator

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/pkosterman/aws-lambda-barcode-generator

Source
Go
Version
v0.0.0-20170813163736-1b1f3b4f8ee6
Version published
Created
Source

AWS Lambda Barcode-generator

This is a sample project to demonstrate usage of Golang for AWS Lambda.

AWS Lambda is a cloud computing service that lets you run code without provisioning or managing servers. AWS Lambda executes your code only when needed and scales automatically.

Currently AWS Lambda natively supports Java, Node.js, Python, and C#.

This project uses a Node.js wrapper to build a Go Lambda function that generates and returns a barcode when triggered by AWS API Gateway. The barcode is returned as a base64 encoded PNG image string.

The Node.js wrapper keeps a Go process around to handle multiple invocations. The first time the function runs it will take a bit longer, but after that it greatly increases performance.

Why Go?

I have been using Go for the past 3 years, it's our language of choice at PassKit because of:

  • Speed! Very fast & a perfect choice for CPU-intensive tasks.
  • Quick & easy to master in a very short amount of time.
  • Portability across platforms.
  • Compiled binariers: plays nice with Docker.
  • Excellent concurreny primitives.
  • Well defined error handling patterns.
  • Rich standard libraries.
  • Standard code formatting / ease of maintenance.

Inspiration

The Node.js wrapper used in this project is inspired by:

Full Demo & Instructions

Click here for a detailed article on how to set this up with AWS API Gateway and Route 53.

Build

Clone this repo and cd into the project root then:

./build.sh

This will place a lambda.zip file into the build folder. You can update this zip file into AWS Lambda.

If you want to run go test, then you will also need to install lambda-test (Node command-line tool). I will place a repo of this on github shortly - just need to rewrite some of the logic.

FAQs

Package last updated on 13 Aug 2017

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