Home / Function/ parseToStruct() — fiber Function Reference

parseToStruct() — fiber Function Reference

Architecture documentation for the parseToStruct() function in mapping.go from the fiber codebase.

Function go DataBinding PayloadParsers calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  ec3e0abf_04f6_4fac_1d98_6e382ea64f69["parseToStruct()"]
  5a1aea01_8a49_a350_626b_5da5e78187fd["mapping.go"]
  ec3e0abf_04f6_4fac_1d98_6e382ea64f69 -->|defined in| 5a1aea01_8a49_a350_626b_5da5e78187fd
  ed7cfcc6_c354_02e5_2860_6f84d4b42410["parse()"]
  ed7cfcc6_c354_02e5_2860_6f84d4b42410 -->|calls| ec3e0abf_04f6_4fac_1d98_6e382ea64f69
  8834e357_99c7_3045_d299_f5f39bd4d596["getDecoderPool()"]
  ec3e0abf_04f6_4fac_1d98_6e382ea64f69 -->|calls| 8834e357_99c7_3045_d299_f5f39bd4d596
  style ec3e0abf_04f6_4fac_1d98_6e382ea64f69 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

binder/mapping.go lines 110–124

func parseToStruct(aliasTag string, out any, data map[string][]string, files ...map[string][]*multipart.FileHeader) error {
	// Get decoder from pool
	pool := getDecoderPool(aliasTag)
	schemaDecoder := pool.Get().(*schema.Decoder) //nolint:errcheck,forcetypeassert // not needed
	defer pool.Put(schemaDecoder)

	// Set alias tag
	schemaDecoder.SetAliasTag(aliasTag)

	if err := schemaDecoder.Decode(out, data, files...); err != nil {
		return fmt.Errorf("bind: %w", err)
	}

	return nil
}

Domain

Subdomains

Defined In

Called By

Frequently Asked Questions

What does parseToStruct() do?
parseToStruct() is a function in the fiber codebase, defined in binder/mapping.go.
Where is parseToStruct() defined?
parseToStruct() is defined in binder/mapping.go at line 110.
What does parseToStruct() call?
parseToStruct() calls 1 function(s): getDecoderPool.
What calls parseToStruct()?
parseToStruct() is called by 1 function(s): parse.

Analyze Your Own Codebase

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

Try Supermodel Free