Home / Function/ buildFieldInfo() — fiber Function Reference

buildFieldInfo() — fiber Function Reference

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

Function go DataBinding PayloadParsers calls 3 called by 1

Entity Profile

Dependency Diagram

graph TD
  ff5020ca_11ae_230b_e44f_8630ed808405["buildFieldInfo()"]
  5a1aea01_8a49_a350_626b_5da5e78187fd["mapping.go"]
  ff5020ca_11ae_230b_e44f_8630ed808405 -->|defined in| 5a1aea01_8a49_a350_626b_5da5e78187fd
  0924903c_1cba_479d_882f_6c9c245c09c1["equalFieldType()"]
  0924903c_1cba_479d_882f_6c9c245c09c1 -->|calls| ff5020ca_11ae_230b_e44f_8630ed808405
  7bae8bd4_bf10_0474_d608_139f15c2bdb1["isExported()"]
  ff5020ca_11ae_230b_e44f_8630ed808405 -->|calls| 7bae8bd4_bf10_0474_d608_139f15c2bdb1
  8bd54148_a46e_ab3b_652f_5c187893a16a["unwrapType()"]
  ff5020ca_11ae_230b_e44f_8630ed808405 -->|calls| 8bd54148_a46e_ab3b_652f_5c187893a16a
  9b3abcd4_ab6d_a5d6_fc1c_7dcefeb5e11b["fieldName()"]
  ff5020ca_11ae_230b_e44f_8630ed808405 -->|calls| 9b3abcd4_ab6d_a5d6_fc1c_7dcefeb5e11b
  style ff5020ca_11ae_230b_e44f_8630ed808405 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

binder/mapping.go lines 285–312

func buildFieldInfo(t reflect.Type, aliasTag string) fieldInfo {
	info := fieldInfo{
		names:       make(map[string]reflect.Kind),
		nestedKinds: make(map[reflect.Kind]struct{}),
	}

	for i := 0; i < t.NumField(); i++ {
		f := t.Field(i)
		if !isExported(&f) {
			continue
		}
		fieldType := unwrapType(f.Type)
		info.names[fieldName(&f, aliasTag)] = fieldType.Kind()

		if fieldType.Kind() == reflect.Struct {
			for j := 0; j < fieldType.NumField(); j++ {
				sf := fieldType.Field(j)
				if !isExported(&sf) {
					continue
				}
				nestedType := unwrapType(sf.Type)
				info.nestedKinds[nestedType.Kind()] = struct{}{}
			}
		}
	}

	return info
}

Domain

Subdomains

Defined In

Called By

Frequently Asked Questions

What does buildFieldInfo() do?
buildFieldInfo() is a function in the fiber codebase, defined in binder/mapping.go.
Where is buildFieldInfo() defined?
buildFieldInfo() is defined in binder/mapping.go at line 285.
What does buildFieldInfo() call?
buildFieldInfo() calls 3 function(s): fieldName, isExported, unwrapType.
What calls buildFieldInfo()?
buildFieldInfo() is called by 1 function(s): equalFieldType.

Analyze Your Own Codebase

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

Try Supermodel Free