lucdoe / opengateway

API Gateway written in Go for small to mid-sized projects. Easy setup, extendable with plugins, and fully customisable.
Apache License 2.0
5 stars 0 forks source link
api-gateway go lightweight yaml-configuration

OpenGateway - lightweight API Gateway

codecov Go Report Card License Build

Welcome to the OpenGateway repo, an lightweight API Gateway written in Go for small to mid-sized projects. Leveraging Go's performance and simplicity, this gateway ensures quick response times and reliable performance without the complexity of larger systems. It is open-source, avoiding vendor lock-in and allowing complete control over deployment and customization through simple YAMl config.

You can easily extend its functionality with configurable plugins, and the setup is straightforward, with minimal configuration needed.

Please also see the architecture diagrams for an overview and better understanding of the architecture.

Local setup

  1. Clone the repository:
    SSH: git clone git@github.com:lucdoe/opengateway.git
    HTTPS: git clone https://github.com/lucdoe/opengateway.git

Docker

Make sure you have Docker with Docker Compose installed on your machine. Docker recommends Docker Desktop for Windows and Mac users.

  1. Edit the cmd/gateway/config.yaml file to your needs
  2. Run Docker compose with docker compose up

Manual

  1. Edit the cmd/gateway/config.yaml file to your needs
  2. Run the gateway with go run cmd/gateway/main.go

Metrics

Benchmark Results

We conducted a performance benchmark using hey with the following parameters:

Summary

Status Code Distribution

Load testing (Locust)

We have conducted load testing on our API Gateway using Locust (200 peaks, 50 ramps, 5m).

Type Name Requests Fails Median (ms) Average (ms) Min (ms) Max (ms) Average size (bytes) Current RPS Current Failures/s
GET /some-endpoint 15,532 0 4 4.93 1 76 1,280 66.8 0

The gateway performs well under the tested load, with no failures and consistent response times.

These results clearly show the API Gateway's performance under load, highlighting its ability to handle many requests efficiently.

License

The code of this repository is licensed under Apache v2.0. Read License tldr for a quick summary.