Home / Function/ paramsMatch() — fiber Function Reference

paramsMatch() — fiber Function Reference

Architecture documentation for the paramsMatch() function in helpers.go from the fiber codebase.

Function go FiberCore Routing calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  a901a40e_1c24_0b91_6e95_807b7ecdec87["paramsMatch()"]
  bec0e401_e4cd_f765_6df3_a79059073e50["helpers.go"]
  a901a40e_1c24_0b91_6e95_807b7ecdec87 -->|defined in| bec0e401_e4cd_f765_6df3_a79059073e50
  5649869c_4dec_c6c6_be75_b82592a3c23f["acceptsOfferType()"]
  5649869c_4dec_c6c6_be75_b82592a3c23f -->|calls| a901a40e_1c24_0b91_6e95_807b7ecdec87
  075b5250_dc10_53b4_3b25_4828630c476f["unescapeHeaderValue()"]
  a901a40e_1c24_0b91_6e95_807b7ecdec87 -->|calls| 075b5250_dc10_53b4_3b25_4828630c476f
  style a901a40e_1c24_0b91_6e95_807b7ecdec87 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

helpers.go lines 375–402

func paramsMatch(specParamStr headerParams, offerParams string) bool {
	if len(specParamStr) == 0 {
		return true
	}

	allSpecParamsMatch := true
	for specParam, specVal := range specParamStr {
		foundParam := false
		fasthttp.VisitHeaderParams(utils.UnsafeBytes(offerParams), func(key, value []byte) bool {
			if utils.EqualFold(specParam, utils.UnsafeString(key)) {
				foundParam = true
				unescaped, err := unescapeHeaderValue(value)
				if err != nil {
					allSpecParamsMatch = false
					return false
				}
				allSpecParamsMatch = utils.EqualFold(specVal, unescaped)
				return false
			}
			return true
		})
		if !foundParam || !allSpecParamsMatch {
			return false
		}
	}

	return allSpecParamsMatch
}

Domain

Subdomains

Defined In

Called By

Frequently Asked Questions

What does paramsMatch() do?
paramsMatch() is a function in the fiber codebase, defined in helpers.go.
Where is paramsMatch() defined?
paramsMatch() is defined in helpers.go at line 375.
What does paramsMatch() call?
paramsMatch() calls 1 function(s): unescapeHeaderValue.
What calls paramsMatch()?
paramsMatch() is called by 1 function(s): acceptsOfferType.

Analyze Your Own Codebase

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

Try Supermodel Free