Skip to content

MonkyMars/gecho

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gecho

gecho banner

A lightweight JSON response builder for Go HTTP handlers.

What it is

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).

Install

Requires Go toolchain.

go get github.com/MonkyMars/gecho

Quick example

// 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()

Project layout

  • gecho.go — package entry points
  • errors/ — error response helpers
  • success/ — success response helpers
  • handlers/ — small built-in handlers (method validation)
  • utils/ — core builder and JSON logic

Contributing

Contributions welcome:) Please open issues or pull requests and include a short description and tests for behavior changes.

About

A simple response library for Go

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages