DEV Community

Claudiu
Claudiu

Posted on • Edited on

1

AWS Lambda Go logging middleware example

For experienced programmers: A recap is always welcomed.

For beginners: you will have a description of what are and how middlewares work in a Go web app. Don't forget, the comments section is open. Leave a comment if you need more explanations.

We will see what middlewares mean from a web application perspective.

What represents the middlewares in a web app?

Middleware is a way for defining the separation of concerns in an application (distributed or not). Sometimes is called "the glue" or "plumbing" since it helps "glue" together different services and passes data between them [1] [2]. Web applications are used for executing a set of instructions before the request is handle by a controller. The instructions are usually to filter the requests (e.g. is this user allowed to access this page?), logging the request and the list can continue.

How to implement a middleware in Golang?

Requirement: Implement a logging middleware for AWS Lambda.

Checkout this repository.

Inspired by:

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Retry later