GroupParam returns the group extracted via the ExtraGroupParam middleware.
(r *http.Request)
| 15 | |
| 16 | // GroupParam returns the group extracted via the ExtraGroupParam middleware. |
| 17 | func GroupParam(r *http.Request) database.Group { |
| 18 | group, ok := r.Context().Value(groupParamContextKey{}).(database.Group) |
| 19 | if !ok { |
| 20 | panic("developer error: group param middleware not provided") |
| 21 | } |
| 22 | return group |
| 23 | } |
| 24 | |
| 25 | func ExtractGroupByNameParam(db database.Store) func(http.Handler) http.Handler { |
| 26 | return func(next http.Handler) http.Handler { |