Home / Function/ staticFileHandler() — gin Function Reference

staticFileHandler() — gin Function Reference

Architecture documentation for the staticFileHandler() function in routergroup.go from the gin codebase.

Function go CoreEngine Middleware calls 3 called by 2

Entity Profile

Dependency Diagram

graph TD
  0f475bc0_3758_8ab9_d4f4_b3dc013570f3["staticFileHandler()"]
  e63de839_1e3a_62df_fb4c_95c0524a7263["StaticFile()"]
  e63de839_1e3a_62df_fb4c_95c0524a7263 -->|calls| 0f475bc0_3758_8ab9_d4f4_b3dc013570f3
  0608b30c_2537_13bb_6aa2_0fd1eaed4d72["StaticFileFS()"]
  0608b30c_2537_13bb_6aa2_0fd1eaed4d72 -->|calls| 0f475bc0_3758_8ab9_d4f4_b3dc013570f3
  619f6c2d_3386_9b29_de8d_037296f038a4["GET()"]
  0f475bc0_3758_8ab9_d4f4_b3dc013570f3 -->|calls| 619f6c2d_3386_9b29_de8d_037296f038a4
  2125b88b_3183_7da9_011d_68f851020f27["HEAD()"]
  0f475bc0_3758_8ab9_d4f4_b3dc013570f3 -->|calls| 2125b88b_3183_7da9_011d_68f851020f27
  6a02d456_ea59_53ed_7657_d6ad4ce99bca["returnObj()"]
  0f475bc0_3758_8ab9_d4f4_b3dc013570f3 -->|calls| 6a02d456_ea59_53ed_7657_d6ad4ce99bca
  style 0f475bc0_3758_8ab9_d4f4_b3dc013570f3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

routergroup.go lines 181–188

func (group *RouterGroup) staticFileHandler(relativePath string, handler HandlerFunc) IRoutes {
	if strings.Contains(relativePath, ":") || strings.Contains(relativePath, "*") {
		panic("URL parameters can not be used when serving a static file")
	}
	group.GET(relativePath, handler)
	group.HEAD(relativePath, handler)
	return group.returnObj()
}

Domain

Subdomains

Frequently Asked Questions

What does staticFileHandler() do?
staticFileHandler() is a function in the gin codebase.
What does staticFileHandler() call?
staticFileHandler() calls 3 function(s): GET, HEAD, returnObj.
What calls staticFileHandler()?
staticFileHandler() is called by 2 function(s): StaticFile, StaticFileFS.

Analyze Your Own Codebase

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

Try Supermodel Free