lambgo

module
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2025 License: MIT

README

Lambgo

CI Go Report Card codecov

Go Version Support

Only the last two minor versions of Go are officially supported.

Install

# Requires Go 1.16+
$ go install github.com/JosiahWitt/lambgo/cmd/lambgo@latest

About

Lambgo is a simple framework for building AWS Lambdas in Go. It currently consists of a CLI to build paths listed in the .lambgo.yml file.

Configuring Lambgo

Lambgo is configured using a .lambgo.yml file which is located in the root of your Go Module (next to the go.mod file).

Here is an example .lambgo.yml file:

# Directory to use as the root for build artifacts.
# Optional, defaults to tmp.
outDirectory: tmp

# File name to use for all zipped binaries.
# Useful when using provided.al2 instead of go1.x for the Lambda runtime.
# Optional, defaults to the name of the Lambda's directory.
# zippedFileName: bootstrap

# Additional build flags passed to "go build"
# For example, if you want to provide extra compiler or linker options
# buildFlags: -tags extra,tags -ldflags="-linker -flags"

# Allow overriding the GOOS and GOARCH environment variables to
# cross compile for a different operating system or architecture.
# Optional, defaults to GOOS=linux and GOARCH=amd64.
# goos: linux
# goarch: amd64

# Paths to build into Lambda zip files.
# Each path should contain a main package.
# The artifacts are built to: <outDirectory>/<buildPath>.zip
buildPaths:
  - lambdas/hello_world

Using the above example file would cause lambgo build to build lambdas/hello_world to tmp/lambdas/hello_world.zip.

Examples

See the examples directory for examples.

Directories

Path Synopsis
cmd
examples
simple Module
internal
cmd
lambgofile
Package lambgofile assists with loading and representing .lambgo.yml files.
Package lambgofile assists with loading and representing .lambgo.yml files.
mocks/io/mock_fs
Package mock_fs is a generated GoMock package.
Package mock_fs is a generated GoMock package.
mocks/mock_builder
Package mock_builder is a generated GoMock package.
Package mock_builder is a generated GoMock package.
mocks/mock_lambgofile
Package mock_lambgofile is a generated GoMock package.
Package mock_lambgofile is a generated GoMock package.
mocks/mock_runcmd
Package mock_runcmd is a generated GoMock package.
Package mock_runcmd is a generated GoMock package.
mocks/mock_zipper
Package mock_zipper is a generated GoMock package.
Package mock_zipper is a generated GoMock package.

Jump to

Keyboard shortcuts

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