My multi-module workspace to make working with AWS services easier. See also:
- github.com/nguyengg/go-to: mixed bag of Go utility packages.
- github.com/nguyengg/gin-seng: Gin middlewares and helper methods.
Available as their own module:
- config-cache (
configcache): single AWS config cache to make using package-level methods easier. - ddb-mapper: add optimistic locking and auto-generated timestamps via struct tags.
- gin-sessions: replaces github.com/gin-contrib/sessions with ddb-mapper integration.
- gin-caching-response-headers (
cachingheaders): sets caching response headers (Cache-Control, ETag, and/or Last-Modified) on the gin response. - gin-json-abort (
abort): provides package-level methods to help abort a gin request using JSON response as well as logging. - gin-metrics (
ginmetrics): replaces gin.Logger and gin.Recovery with metrics.Metrics integration. - gin-preconditions (
preconditions): provides helper methods to parse and compare conditional headers such as If-Match, If-None-Match, If-Modified-Since, and If-Unmodified-Since. - gin-s3-proxy (
proxy): a very simple Gin middleware acting as an S3 proxy. - lambda: Lambda handler wrappers with sensible defaults and metrics integration.
- function-url (
functionurl): provides Lambda wrappers for Function URL gin handlers in either BUFFERED or STREAMING mode. - getenv: decouple how to retrieve a variable of any type (usually string or binary) via AWS Parameter Store and Secrets Lambda extension.
- function-url (
- metrics: logging latency metrics and other custom counters.
- opaque-token (
token): convert DynamoDB last evaluated key to opaque token; create and validate CSRF tokens. - s3reader: implements
io.ReadSeeker,io.ReaderAt, andio.WriterTousing S3 ranged GetObject. - s3writer: implements
io.Writerandio.ReaderFromfor uploading to S3. - scale-in-protection (
sip): protect EC2 AutoScaling instances from being scaled down while busy. - slogging: attach/retrieve to/from context; JSON and error (with stack trace)
slog.Valueimplementations. - sri: Subresource Integrity (SRI) computation and verification.
- tspb: Terminal-Safe Progress Bar (TSPB); when you want your program to show progress bar in interactive mode (with terminal), but log normally otherwise.
Available as package in this module (commons):
- args: iterator to scan text lines from multiple sources.
- errors: convenient methods to extract status code and other metadata from AWS errors.
- executor: Java's Executor for Go.
- fmt: provides fmt.Formatter implementations for printing/logging any data as JSON.
- must: for when you're tired of typing
if a, err := someFunction(); err != niland just want to panic instead.