A lightweight JSON response builder for Go HTTP handlers.
gecho provides a small, fluent API for building and sending consistent JSON HTTP responses from Go handlers (success and error helpers, customizable message/data/status, and built-in method validation helpers).
Requires Go toolchain.
go get github.com/MonkyMars/gecho// in an http.Handler:
gecho.Success(w).WithData(map[string]any{"id":1, "name":"Alice"}).WithMessage("OK").Send()
// convenience error
gecho.BadRequest(w).WithMessage("invalid input").Send()gecho.go— package entry pointserrors/— error response helperssuccess/— success response helpershandlers/— small built-in handlers (method validation)utils/— core builder and JSON logic
Contributions welcome:) Please open issues or pull requests and include a short description and tests for behavior changes.
