Documentation
¶
Overview ¶
Package humanirvana connects a standard Huma API to an existing Nirvana builder.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterLegacy ¶
func RegisterLegacy(builder service.Builder, descriptors []definition.Descriptor) error
RegisterLegacy adds existing descriptors directly to the application's Nirvana builder. Their handler, middleware, binding, and response behavior remain on Nirvana's original execution path.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter registers Huma operations on an application-owned Nirvana builder. Build the builder after all Huma registrations, then Bind its service before serving requests through the API's Adapter.
func NewAdapter ¶
NewAdapter attaches Huma registrations to the existing Nirvana builder.
func (*Adapter) Bind ¶
Bind makes the application-built Nirvana service handle Huma Adapter requests. It must be called once, after builder.Build succeeds and before serving.
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
basic
Package reviewcombination exposes one deterministic native Huma operation with an optional, independent Nirvana legacy route for human inspection.
|
Package reviewcombination exposes one deterministic native Huma operation with an optional, independent Nirvana legacy route for human inspection. |
|
basic/cmd
command
|
|
|
coexist
Package showcase is a synthetic service used to compare the original Nirvana runtime with direct Huma registration plus the legacy adapter entry.
|
Package showcase is a synthetic service used to compare the original Nirvana runtime with direct Huma registration plus the legacy adapter entry. |
|
coexist/cmd
command
|
|
|
middleware
command
Command middleware shows authentication, request-ID logging and an application-owned dependency shared by a legacy Nirvana descriptor and a Huma operation on one Nirvana router.
|
Command middleware shows authentication, request-ID logging and an application-owned dependency shared by a legacy Nirvana descriptor and a Huma operation on one Nirvana router. |
|
internal
|
|
|
middleware
Package middleware provides middleware bridging from Nirvana to Huma.
|
Package middleware provides middleware bridging from Nirvana to Huma. |
|
pilot
Package pilot provides a constrained legacy-handler migration demo.
|
Package pilot provides a constrained legacy-handler migration demo. |
|
router
Package router provides route conversion from Nirvana Definition to Huma Operation.
|
Package router provides route conversion from Nirvana Definition to Huma Operation. |
|
tests
|
|
|
compatibility
Package demo is a test-first migration application using shared Nirvana handlers.
|
Package demo is a test-first migration application using shared Nirvana handlers. |
|
compatibility/cmd
command
|
|
|
compatibility/internal/testkit
Package testkit builds native Huma fixtures on the application's Nirvana router.
|
Package testkit builds native Huma fixtures on the application's Nirvana router. |
|
integration/huma
Package huma is a demo Huma migrated project for migration testing.
|
Package huma is a demo Huma migrated project for migration testing. |
|
integration/huma/cmd
command
|
|
|
integration/nirvana
Package nirvana is a demo Nirvana project for migration testing.
|
Package nirvana is a demo Nirvana project for migration testing. |
|
integration/nirvana/cmd
command
|
|
|
performance/fixture
Package fixture defines the PERF-01 technical fixture: the same five Huma operations served by a standard Huma arm (humago on net/http) and by the adapter arm (humanirvana on a Nirvana router).
|
Package fixture defines the PERF-01 technical fixture: the same five Huma operations served by a standard Huma arm (humago on net/http) and by the adapter arm (humanirvana on a Nirvana router). |
|
performance/loadgen
command
Command loadgen runs one closed-loop PERF-01 measurement against a running arm: warm up, then sample until both the minimum duration and minimum request count are reached (bounded by a maximum duration).
|
Command loadgen runs one closed-loop PERF-01 measurement against a running arm: warm up, then sample until both the minimum duration and minimum request count are reached (bounded by a maximum duration). |
|
performance/perf01
command
Command perf01 runs the full PERF-01 protocol: for every request set P01–P05 and concurrency 1/8/32 it collects 5 valid native/adapter pairs (at most 2 extra attempts), each arm on a fresh server process, and judges every pair by P95(adapter) − P95(native) < 1000µs.
|
Command perf01 runs the full PERF-01 protocol: for every request set P01–P05 and concurrency 1/8/32 it collects 5 valid native/adapter pairs (at most 2 extra attempts), each arm on a fresh server process, and judges every pair by P95(adapter) − P95(native) < 1000µs. |
|
performance/server
command
Command server serves one PERF-01 arm on loopback until SIGTERM.
|
Command server serves one PERF-01 arm on loopback until SIGTERM. |
|
unit/cover01
Package cover01 implements the COVER-01 gate: statement-weighted coverage of the adapter library packages must satisfy 100*covered >= 80*total, computed from one atomic profile with raw integer counts.
|
Package cover01 implements the COVER-01 gate: statement-weighted coverage of the adapter library packages must satisfy 100*covered >= 80*total, computed from one atomic profile with raw integer counts. |
|
unit/cover01/cmd
command
Command cover01 checks a coverage profile against the COVER-01 gate and writes a JSON summary.
|
Command cover01 checks a coverage profile against the COVER-01 gate and writes a JSON summary. |