MCPcopy Index your code
hub / github.com/coder/coder / NotificationTemplateParam

Function NotificationTemplateParam

coderd/httpmw/notificationtemplateparam.go:15–21  ·  view source on GitHub ↗

NotificationTemplateParam returns the template from the ExtractNotificationTemplateParam handler.

(r *http.Request)

Source from the content-addressed store, hash-verified

13
14// NotificationTemplateParam returns the template from the ExtractNotificationTemplateParam handler.
15func NotificationTemplateParam(r *http.Request) database.NotificationTemplate {
16 template, ok := r.Context().Value(notificationTemplateParamContextKey{}).(database.NotificationTemplate)
17 if !ok {
18 panic("developer error: notification template middleware not used")
19 }
20 return template
21}
22
23// ExtractNotificationTemplateParam grabs a notification template from the "notification_template" URL parameter.
24func ExtractNotificationTemplateParam(db database.Store) func(http.Handler) http.Handler {

Callers 1

Calls 2

ContextMethod · 0.65
ValueMethod · 0.45

Tested by

no test coverage detected