MCPcopy
hub / github.com/gorilla/sessions / GetRegistry

Function GetRegistry

sessions.go:109–121  ·  view source on GitHub ↗

GetRegistry returns a registry instance for the current request.

(r *http.Request)

Source from the content-addressed store, hash-verified

107
108// GetRegistry returns a registry instance for the current request.
109func GetRegistry(r *http.Request) *Registry {
110 var ctx = r.Context()
111 registry := ctx.Value(registryKey)
112 if registry != nil {
113 return registry.(*Registry)
114 }
115 newRegistry := &Registry{
116 request: r,
117 sessions: make(map[string]sessionInfo),
118 }
119 *r = *r.WithContext(context.WithValue(ctx, registryKey, newRegistry))
120 return newRegistry
121}
122
123// Registry stores sessions used during a request.
124type Registry struct {

Callers 3

GetMethod · 0.85
GetMethod · 0.85
SaveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…