Home / Function/ Benchmark_QueryBinder_Bind() — fiber Function Reference

Benchmark_QueryBinder_Bind() — fiber Function Reference

Architecture documentation for the Benchmark_QueryBinder_Bind() function in query_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  db6e96c3_1c28_7a26_981a_3dbf86b78301["Benchmark_QueryBinder_Bind()"]
  ec649929_2505_8592_7c6d_a7dfe7415aef["query_test.go"]
  db6e96c3_1c28_7a26_981a_3dbf86b78301 -->|defined in| ec649929_2505_8592_7c6d_a7dfe7415aef
  style db6e96c3_1c28_7a26_981a_3dbf86b78301 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

binder/query_test.go lines 53–86

func Benchmark_QueryBinder_Bind(b *testing.B) {
	b.ReportAllocs()

	binder := &QueryBinding{
		EnableSplitting: true,
	}

	type User struct {
		Name  string   `query:"name"`
		Posts []string `query:"posts"`
		Age   int      `query:"age"`
	}
	var user User

	req := fasthttp.AcquireRequest()
	b.Cleanup(func() {
		fasthttp.ReleaseRequest(req)
	})

	req.URI().SetQueryString("name=john&age=42&posts=post1,post2,post3")

	var err error
	for b.Loop() {
		err = binder.Bind(req, &user)
	}

	require.NoError(b, err)
	require.Equal(b, "john", user.Name)
	require.Equal(b, 42, user.Age)
	require.Len(b, user.Posts, 3)
	require.Contains(b, user.Posts, "post1")
	require.Contains(b, user.Posts, "post2")
	require.Contains(b, user.Posts, "post3")
}

Domain

Subdomains

Frequently Asked Questions

What does Benchmark_QueryBinder_Bind() do?
Benchmark_QueryBinder_Bind() is a function in the fiber codebase, defined in binder/query_test.go.
Where is Benchmark_QueryBinder_Bind() defined?
Benchmark_QueryBinder_Bind() is defined in binder/query_test.go at line 53.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free