Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gopher-fleece/gleece
Gleece - bringing joy and ease to API development in Go!
https://github.com/gopher-fleece/gleece
api gleece go golang openapi openapi3 routes swagger
Last synced: 3 days ago
JSON representation
Gleece - bringing joy and ease to API development in Go!
- Host: GitHub
- URL: https://github.com/gopher-fleece/gleece
- Owner: gopher-fleece
- License: mit
- Created: 2025-01-08T07:53:15.000Z (25 days ago)
- Default Branch: main
- Last Pushed: 2025-01-27T22:44:14.000Z (6 days ago)
- Last Synced: 2025-01-27T23:29:24.725Z (6 days ago)
- Topics: api, gleece, go, golang, openapi, openapi3, routes, swagger
- Language: Go
- Homepage: https://pkg.go.dev/github.com/gopher-fleece/gleece#section-readme
- Size: 322 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
**Gleece** - Bringing joy and ease to API development in Go! ๐
[![gleece](https://github.com/gopher-fleece/gleece/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/gopher-fleece/gleece/actions/workflows/build.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/gopher-fleece/gleece)](https://goreportcard.com/report/gopher-fleece/gleece)
[![Coverage Status](https://coveralls.io/repos/github/gopher-fleece/gleece/badge.svg?branch=main)](https://coveralls.io/github/gopher-fleece/gleece?branch=main)
[![Go Version](https://img.shields.io/github/go-mod/go-version/gopher-fleece/gleece)](https://github.com/gopher-fleece/gleece/blob/main/go.mod)[![VSCode Extension](https://img.shields.io/visual-studio-marketplace/v/haim-kastner.gleece-extension?label=VSCode%20Extension)](https://marketplace.visualstudio.com/items?itemName=haim-kastner.gleece-extension)
[![Documentation](https://img.shields.io/badge/docs-available-brightgreen.svg)](./docs/STEPBYSTEP.md)
[![Latest Release](https://img.shields.io/github/v/release/gopher-fleece/gleece)](https://github.com/gopher-fleece/gleece/releases)
[![Go Reference](https://pkg.go.dev/badge/github.com/gopher-fleece/gleece.svg)](https://pkg.go.dev/github.com/gopher-fleece/gleece)[![OpenAPI 3.0](https://img.shields.io/badge/OpenAPI-3.0.0-green.svg)](https://spec.openapis.org/oas/v3.0.0)
[![OpenAPI 3.1](https://img.shields.io/badge/OpenAPI-3.1.0-green.svg)](https://spec.openapis.org/oas/v3.1.0)
[![Gin Support](https://img.shields.io/badge/Gin-Supported-blue)](https://gin-gonic.com/)
[![Echo Support](https://img.shields.io/badge/Echo-Supported-blue)](https://echo.labstack.com/)[![GitHub stars](https://img.shields.io/github/stars/gopher-fleece/gleece.svg?style=social&label=Stars)](https://github.com/gopher-fleece/gleece/stargazers)
[![License](https://img.shields.io/github/license/gopher-fleece/gleece.svg?style=social)](https://github.com/gopher-fleece/gleece/blob/master/LICENSE)---
## Philosophy
Developing APIs doesnโt have to be a chore - it should be simple, efficient, and enjoyable.Gone are the days of manually writing repetitive boilerplate code or struggling to keep your API documentation in sync with your implementation.
With Gleece, you can:
- ๐ง **Simplify** your API development process.
- ๐ Automatically **generate OpenAPI v3.0.0 / v3.1.0** specification directly from your code.
- ๐ฏ Ensure your APIs are always **well-documented and consistent**.
- โ **Validate input data** effortlessly to keep your APIs robust and secure.
- ๐ **Security first** approach, easy authorization with supplied check function.
- โก๏ธ Choose Your Framework - seamlessly works with both **Gin & Echo** Rest frameworksGleece aims to make Go developersโ lives easier by seamlessly integrating API routes, validation, and documentation into a single cohesive workflow.
## ๐ซ Look & Feel
Hereโs a practical snippet of how Gleece simplifies your API development:
```go
package apiimport (
"github.com/google/uuid"
"github.com/gopher-fleece/gleece/external" // Importing GleeceController
)// @Tag(User Management)
// @Route(/users-management)
// @Description The User Management API
type UserController struct {
external.GleeceController // Embedding the GleeceController
}// @Description User's domicile
type Domicile struct {
// @Description The address
Address string `json:"address" validate:"required"`
// @Description The number of the house (must be at least 1)
HouseNumber int `json:"houseNumber" validate:"gte=1"`
}// @Description Create a new user
// @Method(POST)
// @Route(/user/{user_name})
// @Path(name, { name: "user_name", validate: "required" }) The user's name
// @Query(email, { validate: "required,email" }) The user's email
// @Body(domicile, { validate: "required" }) The user's domicile info
// @Header(origin, { name: "x-origin" }) The request origin
// @Header(trace) The trace info
// @Response(200) The ID of the newly created user
// @ErrorResponse(500) The error when process failed
// @Security(ApiKeyAuth, { scopes: ["read:users", "write:users"] })
func (ec *UserController) CreateNewUser(email string, name string, domicile Domicile, origin string, trace string) (string, error) {
// Do the logic....
userId := uuid.New()
return userId.String(), nil
}
```All other aspects, including HTTP routing generation, authorization enforcement, payload validation, error handling, and OpenAPI v3 specification generation, are handled by Gleece CLI.
## ๐ Documentation
- [Step By Step Guide](./docs/STEPBYSTEP.md)
- [Annotations & Options](./docs/ANNOTATIONS.md)
- [Controllers](./docs/CONTROLLERS.md)
- [Authentication](./docs/AUTHENTICATION.md)
- [Validations](./docs/VALIDATION.md)
- [Error handling](./docs/ERROR_HANDLING.md)
- [Advanced](./docs/ADVANCED.md)## ๐ Integrating with Golang Rest Routers
- [Gin](./docs/GIN_INTEGRATION.md)
- [Echo](./docs/ECHO_INTEGRATION.md)For a complete example project using Gleece, check out the [Gleece Example Project](https://github.com/gopher-fleece/gleecexample#readme). This project demonstrates how to set up and use Gleece in a real-world scenario, providing you with a practical reference to get started quickly.
## ๐จ VSCode Extension
To enhance your development experience with Gleece, we provide an official VSCode extension that provides intelligent annotation highlighting and improved code visibility.
For more information and capabilities see the [Gleece VSCode Extension](https://github.com/gopher-fleece/gleece-vscode-extension#readme).
To install it search `Gleece` in the "Extension" tab or go to the [VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=haim-kastner.gleece-extension).
## โ ๏ธ Disclaimer
Gleece is currently an under-development project. Weโre working hard to make it amazing.Weโd love your feedback and contributions as we shape Gleece!
Stay tuned for updates, and feel free to open issues or pull requests to help us improve!
---
## ๐ License
Gleece is licensed under the [MIT LICENSE](./LICENSE).---