Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/acim/gap

Library for easy implementation of REST API's in Go
https://github.com/acim/gap

Last synced: 10 days ago
JSON representation

Library for easy implementation of REST API's in Go

Awesome Lists containing this project

README

        

# gap

[![pipeline](https://github.com/acim/gap/actions/workflows/pipeline.yaml/badge.svg)](https://github.com/acim/gap/actions/workflows/pipeline.yaml)
[![Go Reference](https://pkg.go.dev/badge/go.acim.net/gap.svg)](https://pkg.go.dev/go.acim.net/gap)
[![Go Report](https://goreportcard.com/badge/go.acim.net/gap)](https://goreportcard.com/report/go.acim.net/gap)
![Go Coverage](https://img.shields.io/badge/coverage-92.6%25-brightgreen?style=flat&logo=go)

Library for easy implementation of REST API's in Go. Besides helpers to decode and encode JSON payloads using standard library _http.HandlerFunc_ type of handler, this library supports handler functions returning errors, e.g. _func(w http.ResponseWriter, req \*http.Request) error_ and makes errors handling much easier. Finally, it also contains idiomatic Go middlewares for HTTP request logging using [slog](https://pkg.go.dev/golang.org/x/exp/slog) and [zap](https://github.com/uber-go/zap) loggers. Please look at the tests for example usages.

## Warning :construction:

This project is in an early stage so you can expect API breaking changes until the first major release.

## License

Licensed under either of

- Apache License, Version 2.0
([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license
([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)

at your option.

## Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.