MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / templateRegistryFromContext

Function templateRegistryFromContext

pkg/email/template.go:35–38  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

33var templateRegistryCtxKey templateRegistryCtxKeyType
34
35func templateRegistryFromContext(ctx context.Context) (TemplateRegistry, bool) {
36 reg, ok := ctx.Value(templateRegistryCtxKey).(TemplateRegistry)
37 return reg, ok
38}
39
40func newContextWithTemplateRegistry(parent context.Context, reg TemplateRegistry) context.Context {
41 return context.WithValue(parent, templateRegistryCtxKey, reg)

Callers 1

GetTemplateFunction · 0.85

Calls 1

ValueMethod · 0.45

Tested by

no test coverage detected