Home / Function/ Generate() — fiber Function Reference

Generate() — fiber Function Reference

Architecture documentation for the Generate() function in etag.go from the fiber codebase.

Function go FiberCore Adapters calls 1 called by 2

Entity Profile

Dependency Diagram

graph TD
  bf507e91_53f1_f386_5bf6_f1e81b6cd10b["Generate()"]
  e660d89f_158e_a31e_1a40_def5af9d743a["etag.go"]
  bf507e91_53f1_f386_5bf6_f1e81b6cd10b -->|defined in| e660d89f_158e_a31e_1a40_def5af9d743a
  8fcfa90d_475d_4083_86aa_d99375e797df["GenerateWeak()"]
  8fcfa90d_475d_4083_86aa_d99375e797df -->|calls| bf507e91_53f1_f386_5bf6_f1e81b6cd10b
  ff55d799_cd38_2358_2bd9_9d94fb74dfed["New()"]
  ff55d799_cd38_2358_2bd9_9d94fb74dfed -->|calls| bf507e91_53f1_f386_5bf6_f1e81b6cd10b
  08b4a835_8759_ddf9_104e_79f10250261f["appendUint()"]
  bf507e91_53f1_f386_5bf6_f1e81b6cd10b -->|calls| 08b4a835_8759_ddf9_104e_79f10250261f
  style bf507e91_53f1_f386_5bf6_f1e81b6cd10b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/etag/etag.go lines 19–32

func Generate(body []byte) []byte {
	if len(body) > math.MaxUint32 {
		return nil
	}
	bb := bytebufferpool.Get()
	defer bytebufferpool.Put(bb)
	b := bb.B[:0]
	b = append(b, '"')
	b = appendUint(b, uint32(len(body))) // #nosec G115 -- length checked above
	b = append(b, '-')
	b = appendUint(b, crc32.Checksum(body, crc32q))
	b = append(b, '"')
	return slices.Clone(b)
}

Domain

Subdomains

Calls

Frequently Asked Questions

What does Generate() do?
Generate() is a function in the fiber codebase, defined in middleware/etag/etag.go.
Where is Generate() defined?
Generate() is defined in middleware/etag/etag.go at line 19.
What does Generate() call?
Generate() calls 1 function(s): appendUint.
What calls Generate()?
Generate() is called by 2 function(s): GenerateWeak, New.

Analyze Your Own Codebase

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

Try Supermodel Free