• Stars
    star
    6
  • Rank 2,459,084 (Top 50 %)
  • Language
    Go
  • License
    MIT License
  • Created about 2 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Use Go for AWS Lambda & API Gateway HttpApi

Golamb

Go Reference codecov

Golamb makes it easier to write AWS Lambda functions in Go that are invoked by API Gateway Http APIs.

Documentation

For full documentation see pkg.go.dev.

Usage

Basic

package main

import (
	"net/http"

	"github.com/aws/aws-sdk-go/service/dynamodb"
	"github.com/twharmon/golamb"
)

func handler(c golamb.Context) golamb.Responder {
	// Get a query parameter
	foo := c.Request().Query("foo")

	// Get a path parameter
	bar := c.Request().Path("bar")

	return c.Response(http.StatusOK, map[string]any{
		"foo": foo,
		"bar": bar,
	})
}

func main() {
	golamb.Start(handler)
}

Contribute

Make a pull request.