rest-go alternatives and similar packages
Based on the "Utilities" category.
Alternatively, view rest-go alternatives based on common mentions on social networks and blogs.
-
项目文档
基于vite+vue3+gin搭建的开发基础平台(支持TS,JS混用),集成jwt鉴权,权限管理,动态路由,显隐可控组件,分页封装,多点登录拦截,资源权限,上传下载,代码生成器,表单生成器,chatGPT自动查表等开发必备功能。 -
excelize
Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets -
godotenv
A Go port of Ruby's dotenv library (Loads environment variables from .env files) -
hystrix-go
Netflix's Hystrix latency and fault tolerance library, for Go -
Kopia
Cross-platform backup tool for Windows, macOS & Linux with fast, incremental backups, client-side end-to-end encryption, compression and data deduplication. CLI and GUI included. -
go-funk
A modern Go utility library which provides helpers (map, find, contains, filter, ...) -
gorequest
GoRequest -- Simplified HTTP client ( inspired by nodejs SuperAgent ) -
goreporter
A Golang tool that does static analysis, unit testing, code review and generate code quality report. -
lancet
A comprehensive, efficient, and reusable util function library of Go. -
gojson
Automatically generate Go (golang) struct definitions from example JSON -
create-go-app
✨ A complete and self-contained solution for developers of any qualification to create a production-ready project with backend (Go), frontend (JavaScript, TypeScript) and deploy automation (Ansible, Docker) by running only one CLI command. -
spinner
Go (golang) package with 90 configurable terminal spinner/progress indicators. -
EaseProbe
A simple, standalone, and lightweight tool that can do health/status checking, written in Go. -
filetype
Fast, dependency-free Go package to infer binary file types based on the magic numbers header signature -
boilr
:zap: boilerplate template manager that generates files or directories from template repositories -
mole
CLI application to create ssh tunnels focused on resiliency and user experience. -
beaver
💨 A real time messaging system to build a scalable in-app notifications, multiplayer games, chat apps in web and mobile apps. -
mimetype
A fast Golang library for media type and file extension detection, based on magic numbers -
go-underscore
Helpfully Functional Go - A useful collection of Go utilities. Designed for programmer happiness. -
JobRunner
Framework for performing work asynchronously, outside of the request flow -
git-time-metric
Simple, seamless, lightweight time tracking for Git
Collect and Analyze Billions of Data Points in Real Time
Do you think we are missing an alternative of rest-go or a related project?
Popular Comparisons
README
Rest GO - Helpful library for Rest API
A package that provide many helpful methods for working with rest api.
And if u are tired of written, this:
func SomeHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Add("Content-Type", "application/json")
product := &product{"Smart TV", 50.00}
bytes, err := json.Marshal(product)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
// this is super bad!
message := fmt.Sprintf(`{"message": "%s"}`, err.Error())
w.Write([]byte(message))
return
}
w.WriteHeader(http.StatusOk)
w.Write(bytes)
}
Get started:
- Install rest GO with one line of code
rest
package
The rest
package provides some helpful methods that allow you to write better rest api in GO.
- Allows for very readable code
See it in action:
package yours
import (
"github.com/edermanoel94/rest-go"
"net/http"
)
type product struct {
Name string `json:"name"`
Price float32 `json:"price"`
}
func SomeHandler(w http.ResponseWriter, r *http.Request) {
rest.Marshalled(w, &product{"Smart TV", 50.00}, http.StatusOK)
}
A payload send to your API and desarialize to a struct, to easy!
package yours
import (
"github.com/edermanoel94/rest-go"
"net/http"
)
type product struct {
Name string `json:"name"`
Price float32 `json:"price"`
}
// [POST] body: {"name": "eder", "price": 20.00}
func SomePostHandler(w http.ResponseWriter, r *http.Request) {
product := product{}
err := rest.GetBody(r.Body, &product)
if err != nil {
// do stuff with error
}
// Do stuff...
}
Working with mux
package to check if path variable exist.
package yours
import (
"github.com/edermanoel94/rest-go"
"github.com/gorilla/mux"
"net/http"
)
type product struct {
Name string `json:"name"`
Price float32 `json:"price"`
}
// [GET] url: /product/{id}
func SomePostHandler(w http.ResponseWriter, r *http.Request) {
params := mux.Vars(r)
err := rest.CheckPathVariables(params, "id")
if err != nil {
// do stuff with error
}
}
TODO List
- [x] Working with custom errors
- [ ] Add Response for ALB and API Gateway
- [ ] Benchmarking (Memory, CPU)
- [ ] Working with CheckPathVariables and GetPathVariable in Standard library
- [ ] More tests
- [ ] Working with pagination
Installation
To install, use go get
using go modules:
go get github.com/edermanoel94/rest-go@latest
Example
To install and build:
cd examples
And use go modules for install packages:
go mod tidy
Then, to run:
go build
Contributing
Please feel free to submit issues, fork the repository and send pull requests!
License
This project is licensed under the terms of the MIT license.
*Note that all licence references and agreements mentioned in the rest-go README section above
are relevant to that project's source code only.