aws-lambda-barcode-generator

command module
v0.0.0-...-1b1f3b4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2017 License: MIT Imports: 11 Imported by: 0

README

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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
lib

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL