pixiu icon indicating copy to clipboard operation
pixiu copied to clipboard

Optimized the HTTP bind util with streaming style

Open crazytaxii opened this issue 8 months ago • 0 comments

What type of PR is this?

/kind optimization

What this PR does / why we need it:

Optimized the HTTP bind util with a streaming style. For example:

var (
	idMeta   IdMeta
	req         types.UpdateClusterRequest
	listOpts types.ListOptions
)

if err := httputils.ShouldBind(c).WithUri(&idMeta).WithBody(&req).WithQuery(&listOpts).Error(); err != nil {
	// error handle
}

It's optional and flexible, maybe a little bit graceful.

Does this PR introduce a user-facing change?

NONE

crazytaxii avatar Jun 15 '24 13:06 crazytaxii