MCPcopy
hub / github.com/danielgtaylor/huma / BenchmarkRegister

Function BenchmarkRegister

bench_test.go:152–165  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

150}
151
152func BenchmarkRegister(b *testing.B) {
153 _, api := humatest.New(b, huma.DefaultConfig("Test API", "1.0.0"))
154
155 b.ResetTimer()
156 b.ReportAllocs()
157 for i := 0; i < b.N; i++ {
158 huma.Register(api, huma.Operation{
159 Method: http.MethodPost,
160 Path: fmt.Sprintf("/test-%d", i),
161 }, func(ctx context.Context, input *ComplexInput) (*ComplexOutput, error) {
162 return nil, nil
163 })
164 }
165}
166
167type ComplexInput struct {
168 ID string `path:"id"`

Callers

nothing calls this directly

Calls 1

NewFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…