MCPcopy
hub / github.com/gofiber/fiber / Locals

Method Locals

req_interface_gen.go:130–130  ·  view source on GitHub ↗

Locals makes it possible to pass any values under keys scoped to the request and therefore available to all following routes that match the request. All the values are removed from ctx after returning from the top RequestHandler. Additionally, Close method is called on each value implementing io.Cl

(key any, value ...any)

Source from the content-addressed store, hash-verified

128 // RequestHandler. Additionally, Close method is called on each value
129 // implementing io.Closer before removing the value from ctx.
130 Locals(key any, value ...any) any
131 // Method returns the HTTP request method for the context, optionally overridden by the provided argument.
132 // If no override is given or if the provided override is not a valid HTTP method, it returns the current method from the context.
133 // Otherwise, it updates the context's method and returns the overridden method as a string.

Callers 15

StoreInContextFunction · 0.65
TestStoreInContextFunction · 0.65
TestValueFromContextFunction · 0.65
LocalsFunction · 0.65
DomainParamFunction · 0.65
wrapHandlersMethod · 0.65
Test_Ctx_LocalsFunction · 0.65
Test_Ctx_ValueFunction · 0.65

Implementers 1

Calls

no outgoing calls

Tested by 15

TestStoreInContextFunction · 0.52
TestValueFromContextFunction · 0.52
Test_Ctx_LocalsFunction · 0.52
Test_Ctx_ValueFunction · 0.52