MCPcopy
hub / github.com/gorilla/mux / Populate

Method Populate

example_authentication_middleware_test.go:16–21  ·  view source on GitHub ↗

Initialize it somewhere

()

Source from the content-addressed store, hash-verified

14
15// Initialize it somewhere
16func (amw *authenticationMiddleware) Populate() {
17 amw.tokenUsers["00000000"] = "user0"
18 amw.tokenUsers["aaaaaaaa"] = "userA"
19 amw.tokenUsers["05f717e5"] = "randomUser"
20 amw.tokenUsers["deadbeef"] = "user0"
21}
22
23// Middleware function, which will be called for each request
24func (amw *authenticationMiddleware) Middleware(next http.Handler) http.Handler {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected