Home / Function/ Value() — gin Function Reference

Value() — gin Function Reference

Architecture documentation for the Value() function in context.go from the gin codebase.

Function go CoreEngine Context calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  a4eb6295_848c_5468_4e03_d8442b59ed6c["Value()"]
  016d869c_1ec8_be53_c826_1bf4397776e5["ClientIP()"]
  016d869c_1ec8_be53_c826_1bf4397776e5 -->|calls| a4eb6295_848c_5468_4e03_d8442b59ed6c
  44988509_10d5_0b14_a382_53a2f1657cd7["Get()"]
  a4eb6295_848c_5468_4e03_d8442b59ed6c -->|calls| 44988509_10d5_0b14_a382_53a2f1657cd7
  5f5aca8b_fde5_e7b9_bbb2_2471522dc066["hasRequestContext()"]
  a4eb6295_848c_5468_4e03_d8442b59ed6c -->|calls| 5f5aca8b_fde5_e7b9_bbb2_2471522dc066
  style a4eb6295_848c_5468_4e03_d8442b59ed6c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

context.go lines 1466–1482

func (c *Context) Value(key any) any {
	if key == ContextRequestKey {
		return c.Request
	}
	if key == ContextKey {
		return c
	}
	if keyAsString, ok := key.(string); ok {
		if val, exists := c.Get(keyAsString); exists {
			return val
		}
	}
	if !c.hasRequestContext() {
		return nil
	}
	return c.Request.Context().Value(key)
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does Value() do?
Value() is a function in the gin codebase.
What does Value() call?
Value() calls 2 function(s): Get, hasRequestContext.
What calls Value()?
Value() is called by 1 function(s): ClientIP.

Analyze Your Own Codebase

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

Try Supermodel Free