Discover Packages
github.com/TakuyaYagam1/go-httpkit
module
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Mar 13, 2026
License: MIT
Opens a new window with license information.
README
README
¶
go-httpkit
Simple HTTP utilities for Go projects (chi, JSON, validation, errors, metrics).
Install
go get github.com/TakuyaYagam1/go-httpkit
Packages
httperr — Typed HTTP errors with status and code, Unwrap(), sentinels (ErrInvalidID, ErrNotAuthenticated), NewValidationErrorf.
httputil — JSON render (RenderOK, RenderCreated, RenderError, …), HandleError (map httperr to JSON), request decode/validate (DecodeAndValidate, DecodeJSON with size limit and no trailing data), UUID params (ParseUUID, ParseAuthUserID), GetClientIP (trusted proxies), multipart limit, download helpers (RenderJSONAttachment, RenderStream, RenderBytes), search (EscapeILIKE, ValidateSearchQ), pagination (ClampPage, ParseIntQuery, Ptr).
httputil/middleware — Prometheus metrics (http_requests_total, http_request_duration_seconds); path from request via PathFromRequest (e.g. chi route pattern).
Requires go-chi/render and go-playground/validator in your app for full use. Validator interface: Validate(any) error.
Expand ▾
Collapse ▴
Directories
¶
Click to show internal directories.
Click to hide internal directories.