Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/savsgio/atreugo
High performance and extensible micro web framework. Zero memory allocations in hot paths.
https://github.com/savsgio/atreugo
atreugo extensible fast fasthttp go golang micro-framework performance zero
Last synced: 1 day ago
JSON representation
High performance and extensible micro web framework. Zero memory allocations in hot paths.
- Host: GitHub
- URL: https://github.com/savsgio/atreugo
- Owner: savsgio
- License: apache-2.0
- Created: 2018-05-21T12:32:23.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-12-04T10:03:49.000Z (9 days ago)
- Last Synced: 2024-12-04T11:19:45.052Z (9 days ago)
- Topics: atreugo, extensible, fast, fasthttp, go, golang, micro-framework, performance, zero
- Language: Go
- Homepage:
- Size: 450 KB
- Stars: 1,243
- Watchers: 26
- Forks: 72
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-go - Atreugo - High performance and extensible micro web framework with zero memory allocations in hot paths built on top of [fasthttp](https://github.com/valyala/fasthttp). (Web frameworks)
- awesome-go - Atreugo - High performance and extensible micro web framework with zero memory allocations in hot paths. Stars:`1.2K`. (Web Frameworks / Utility/Miscellaneous)
- awesome-golang-repositories - atreugo
README
# Atreugo
[![Test status](https://github.com/savsgio/atreugo/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/savsgio/atreugo/actions?workflow=test)
[![Coverage Status](https://coveralls.io/repos/github/savsgio/atreugo/badge.svg?branch=master)](https://coveralls.io/github/savsgio/atreugo?branch=master)
[![Go Report Card](https://goreportcard.com/badge/github.com/savsgio/atreugo/v11)](https://goreportcard.com/report/github.com/savsgio/atreugo/v11)
[![GoDev](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white)](https://pkg.go.dev/github.com/savsgio/atreugo/v11)
[![GitHub release](https://img.shields.io/github/release/savsgio/atreugo.svg)](https://github.com/savsgio/atreugo/releases)High performance and extensible micro web framework with zero memory allocations in hot paths.
It's built on top of [fasthttp](https://github.com/valyala/fasthttp).
## Install
```bash
go get github.com/savsgio/atreugo/v11
```## Supported Go versions:
- 1.23.x
- 1.22.x
- 1.21.x## Documentation
See: [docs](https://github.com/savsgio/atreugo/tree/master/docs)
## Organization
Find useful libraries like middlewares, websocket, etc.
- See: [Organization](https://github.com/atreugo)
## Feature Overview
- Optimized for speed. Easily handles more than 100K qps and more than 1M concurrent keep-alive connections on modern hardware.
- Optimized for low memory usage.
- Easy 'Connection: Upgrade' support via RequestCtx.Hijack.
- Server provides anti-DoS limits.
- Middlewares support:
- Before view execution.
- After view execution.- Easy routing:
- Path parameters (mandatories and optionals).
- Views with timeout.
- Group paths and middlewares.
- Static files.
- Serve one file like pdf, etc.
- Middlewares for specific views.
- fasthttp handlers support.
- net/http handlers support.- Common responses (also you could use your own responses):
- JSON
- HTTP
- Text
- Raw
- File
- Redirect## Examples:
Go to [examples](https://github.com/atreugo/examples) to see how to use Atreugo.
## Note:
`*atreugo.RequestCtx` is equal to `*fasthttp.RequestCtx`, but with extra functionalities, so you can use
the same functions of `*fasthttp.RequestCtx`. Don't worry :smile:## Benchmark
**Best Performance:** Atreugo is **one of the fastest** go web frameworks in the [go-web-framework-benchmark](https://github.com/smallnest/go-web-framework-benchmark).
- Basic Test: The first test case is to mock 0 ms, 10 ms, 100 ms, 500 ms processing time in handlers.
![](https://raw.githubusercontent.com/smallnest/go-web-framework-benchmark/master/benchmark.png)
- Concurrency Test (allocations): In 30 ms processing time, the test result for 100, 1000, 5000 clients is:
\* _Smaller is better_
![](https://raw.githubusercontent.com/smallnest/go-web-framework-benchmark/master/concurrency_alloc.png)
# Contributing
**Feel free to contribute or fork me...** :wink: