docs(web): fix non-compiling doc examples; bump to v1.1.0 #1

Merged
Rene Nochebuena merged 1 commits from release/v1.1.0 into main 2026-08-07 19:07:58 -06:00
9 changed files with 29 additions and 18 deletions
Showing only changes of commit 311e92cfc6 - Show all commits
+15 -4
View File
@@ -6,13 +6,24 @@ This module adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html
--- ---
## [1.0.1] — 2026-05-28 ## [1.1.0] — 2026-08-07
Coordinated framework release. Documentation fixes plus the framework version bump
(which finally makes the previously-drafted `contracts` v1.1.0 pin real).
### Fixed
- **Package doc examples didn't compile.** Verified by compiling the example patterns
against the real API:
- `mw.Recover()` -> `mw.Recover(logger)` — the recover middleware takes a `logging.Logger`
(`server`, `mw` package docs and `server.go`).
- `health.NewHandler(logger, …)` -> `health.NewHandler(logger, …).ServeHTTP` — the handler
returns `http.Handler`, but chi's `Get` takes `http.HandlerFunc`; same for
`NewHandlerWithConfig` (`server`, `web`, `health` package docs).
### Changed ### Changed
- Bumped `code.nochebuena.dev/einherjar/contracts` dependency from v1.0.0 to v1.1.0. - Bumped `contracts` and `core` to v1.1.0 (framework version alignment).
No code changes — MVS selects v1.1.0 automatically when a consumer (e.g. `auth`)
requires the new `SecurityBag` API. This pin makes the minimum explicit.
--- ---
+1 -1
View File
@@ -1,6 +1,6 @@
# einherjar/web # einherjar/web
[![version](https://img.shields.io/badge/version-v1.0.0-5C4EE5?style=flat-square)](https://code.nochebuena.dev/einherjar/web) [![version](https://img.shields.io/badge/version-v1.1.0-5C4EE5?style=flat-square)](https://code.nochebuena.dev/einherjar/web)
[![license](https://img.shields.io/badge/license-AGPL--3.0-22863A?style=flat-square)](LICENSE) [![license](https://img.shields.io/badge/license-AGPL--3.0-22863A?style=flat-square)](LICENSE)
[![go](https://img.shields.io/badge/Go-1.26+-00ADD8?style=flat-square&logo=go&logoColor=white)](https://go.dev) [![go](https://img.shields.io/badge/Go-1.26+-00ADD8?style=flat-square&logo=go&logoColor=white)](https://go.dev)
+1 -1
View File
@@ -18,7 +18,7 @@
// lc := launcher.New(logger) // lc := launcher.New(logger)
// //
// srv := web.New(logger) // srv := web.New(logger)
// srv.Get("/health", health.NewHandler(logger, db, cache)) // srv.Get("/health", health.NewHandler(logger, db, cache).ServeHTTP)
// //
// lc.Append(srv) // lc.Append(srv)
// lc.BeforeStart(func() error { // lc.BeforeStart(func() error {
+2 -2
View File
@@ -3,8 +3,8 @@ module code.nochebuena.dev/einherjar/web
go 1.26 go 1.26
require ( require (
code.nochebuena.dev/einherjar/contracts v1.0.0 code.nochebuena.dev/einherjar/contracts v1.1.0
code.nochebuena.dev/einherjar/core v1.0.0 code.nochebuena.dev/einherjar/core v1.1.0
github.com/go-chi/chi/v5 v5.2.1 github.com/go-chi/chi/v5 v5.2.1
github.com/google/uuid v1.6.0 github.com/google/uuid v1.6.0
golang.org/x/time v0.11.0 golang.org/x/time v0.11.0
+4 -4
View File
@@ -1,7 +1,7 @@
code.nochebuena.dev/einherjar/contracts v1.0.0 h1:hRudEtOIqU7vwedYLsCh8+9q5dCnKb61qX+zibqImRU= code.nochebuena.dev/einherjar/contracts v1.1.0 h1:GsGr6reyrd9qCc7D8CqbT1LWPTeeK9lT4r4EdsNA5Ro=
code.nochebuena.dev/einherjar/contracts v1.0.0/go.mod h1:ccltUtrFb5+MEJdkx2VVEUL+xC5pupVlVVsMM8AlCWI= code.nochebuena.dev/einherjar/contracts v1.1.0/go.mod h1:ccltUtrFb5+MEJdkx2VVEUL+xC5pupVlVVsMM8AlCWI=
code.nochebuena.dev/einherjar/core v1.0.0 h1:AueZgfjp3+rQmDKOxmJQ945TTh+sqC1l/xJdTOdbr9w= code.nochebuena.dev/einherjar/core v1.1.0 h1:zxj9bFPthEEFRnvWV/vgNZqWa2y/kAo3p5pODWablyk=
code.nochebuena.dev/einherjar/core v1.0.0/go.mod h1:0IywfRnJXX9xXQO6iPVaq2QDlXbbpXrB8A4T7gO8nE4= code.nochebuena.dev/einherjar/core v1.1.0/go.mod h1:Ot2JbjsnZ33Ed5C9Ev1kSn2PW+F4dLz/LRwIUh+fYt0=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/gabriel-vasile/mimetype v1.4.12 h1:e9hWvmLYvtp846tLHam2o++qitpguFiYCKbn0w9jyqw= github.com/gabriel-vasile/mimetype v1.4.12 h1:e9hWvmLYvtp846tLHam2o++qitpguFiYCKbn0w9jyqw=
+2 -2
View File
@@ -12,12 +12,12 @@
// //
// # Example // # Example
// //
// srv.Get("/health", health.NewHandler(logger, db, cache, storage)) // srv.Get("/health", health.NewHandler(logger, db, cache, storage).ServeHTTP)
// //
// Or with custom timeout: // Or with custom timeout:
// //
// srv.Get("/health", health.NewHandlerWithConfig(logger, // srv.Get("/health", health.NewHandlerWithConfig(logger,
// health.Config{CheckTimeout: 3 * time.Second}, // health.Config{CheckTimeout: 3 * time.Second},
// db, cache, // db, cache,
// )) // ).ServeHTTP)
package health package health
+1 -1
View File
@@ -6,7 +6,7 @@
// # Recommended middleware order (outermost first) // # Recommended middleware order (outermost first)
// //
// server.WithMiddleware( // server.WithMiddleware(
// mw.Recover(), // mw.Recover(logger),
// mw.RequestID(uuid.NewString), // mw.RequestID(uuid.NewString),
// mw.RequestLogger(logger), // mw.RequestLogger(logger),
// mw.CORS([]string{"https://example.com"}), // mw.CORS([]string{"https://example.com"}),
+2 -2
View File
@@ -12,14 +12,14 @@
// //
// srv := server.New(logger, server.Config{Port: 8080}, // srv := server.New(logger, server.Config{Port: 8080},
// server.WithMiddleware( // server.WithMiddleware(
// mw.Recover(), // mw.Recover(logger),
// mw.RequestID(myIDGenerator), // mw.RequestID(myIDGenerator),
// mw.RequestLogger(logger), // mw.RequestLogger(logger),
// mw.CORS([]string{"https://example.com"}), // mw.CORS([]string{"https://example.com"}),
// ), // ),
// ) // )
// //
// srv.Get("/health", health.NewHandler(logger, db)) // srv.Get("/health", health.NewHandler(logger, db).ServeHTTP)
// //
// lc := launcher.New(logger) // lc := launcher.New(logger)
// lc.Append(srv) // lc.Append(srv)
+1 -1
View File
@@ -7,7 +7,7 @@
// //
// srv := server.New(logger, server.Config{Port: 8080}, // srv := server.New(logger, server.Config{Port: 8080},
// server.WithMiddleware( // server.WithMiddleware(
// mw.Recover(), // mw.Recover(logger),
// mw.RequestID(uuid.NewString), // mw.RequestID(uuid.NewString),
// mw.RequestLogger(logger), // mw.RequestLogger(logger),
// ), // ),