v1.0.0: Public API, Observability, Testing & DX#58
Merged
FumingPower3925 merged 8 commits intomainfrom Mar 12, 2026
Merged
Conversation
- Add Engine.Addr() to interface for bound listener address discovery - Remove redundant addrEngine interface from adaptive engine - Add H2 HEAD response body suppression in conn/response.go (RFC 9110 §9.3.2) - Add H2 request body size cap (100MB) with RST_STREAM on overflow
Core public API surface for the v1.0.0 release: - Server: New, Start, StartWithContext, Shutdown, Addr, Use, Group, Routes, URL, URLMap, NotFound, MethodNotAllowed, Collector, EngineInfo - Context: request introspection (Method, Path, Param, ParamInt, ParamInt64, Query, QueryDefault, QueryInt, Header, Body, Cookie, BasicAuth, Scheme, ClientIP, FormValue, FormValueOk, FormFile, Keys), response writing (JSON, XML, HTML, String, Blob, NoContent, Redirect, File, FileFromDir, Stream, SetCookie), middleware flow (Next, Abort, AbortWithStatus), context values (Set, Get, Context, SetContext) - Config: Addr, Protocol, Engine, Workers, Objective, timeouts, MaxFormSize, ShutdownTimeout, Logger - Router: radix trie with :param and *catchAll, static priority, 405 detection, named routes, double-slash normalization, catchall dedup - RouteGroup: prefix-based grouping with inherited middleware - Bridge: Adapt/AdaptFunc for net/http Handler compatibility (100MB cap) - HandlerFunc: func(*Context) error with error-returning middleware chain - Engine factories: engine_linux.go (all 4 engines), engine_other.go (std) - internal/ctxkit: hook variables for cross-package context access
- Collector: lock-free request/error/connection counters via atomic ops - Snapshot: point-in-time copy with latency histogram (10 buckets) - SetEngineMetricsFn: deferred engine metrics callback - Remove Prometheus, debug, and Observer from observe/ (moved to middlewares)
…, server, bridge, benchmarks Add celeristest/ package with NewContext/NewContextT, ResponseRecorder, and functional options (WithBody, WithHeader, WithQuery, WithParam, WithContentType). Add unit tests for Context (ParamInt, QueryDefault, HTML, FormValueOk, FileFromDir traversal, Keys, Scheme), Router edge cases (catchall dedup, trailing slash, param/catchall at root), Server (URLMap), Bridge, and observability Collector. Add benchmarks and example tests.
Update CI workflow for Go 1.26 and new package structure. Migrate magefile from mage.go to magefile.go. Update go.mod dependencies. Add CONTRIBUTING.md, SECURITY.md, issue templates, and PR template. Update README for v1.0.0 public API.
…lders - Fix MaxFormSize=-1 silently ignored (handler.go: != 0, context.go: map -1 → MaxInt64) - Remove dead queryCache nil check in Query() (url.ParseQuery never returns nil) - Add ErrDuplicateRouteName sentinel and Route.TryName() error variant of Name() - Add Config.DisableMetrics to opt out of built-in metrics collector - Extract shared buildURL() helper, refactor URL() and URLMap() as wrappers - Document streaming buffered limitation in doc.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete v1.0.0 release implementing the full public API surface, observability layer, comprehensive test suite, and developer experience features.
Engine & Protocol
Engine.Addr()to interface for port discoveryaddrEngineinterfacePublic API (
celerispackage)New(),Start(),Shutdown(),Routes(),URL(),URLMap(),NotFound(),MethodNotAllowed()Param/ParamInt/ParamInt64,Query/QueryDefault/QueryInt,Header/SetHeader,Cookie/SetCookie,ClientIP(),Scheme(),BasicAuth(), form handling (FormValue/FormValues/FormFile/MultipartForm/FormValueOk), response methods (String/JSON/XML/HTML/Blob/File/FileFromDir/Stream/Redirect/NoContent),Get/Set/Keysstore, error-returningHandlerFunc:paramand*catchAll, named routes, 405 detection, double-slash normalization, route validationObjectivetyped enum,ShutdownTimeout,MaxFormSizeAdapt(http.Handler),AdaptFunc(http.HandlerFunc)with 100MB buffer cap and content-length validationGroup(),Use(), HTTP method registrationObservability
Collectorwith latency histogram viaatomic.Int64Snapshotstruct for point-in-time metricsTesting & DX
celeristestpackage:NewContext/NewContextT,ResponseRecorder, functional optionsFileFromDir()with path traversal protectionBuild & Community
Closes
Test plan
go test ./...)