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

Function defaultNotificationsConfig

coderd/notifications/utils_test.go:23–52  ·  view source on GitHub ↗
(method database.NotificationMethod)

Source from the content-addressed store, hash-verified

21)
22
23func defaultNotificationsConfig(method database.NotificationMethod) codersdk.NotificationsConfig {
24 var (
25 smtp codersdk.NotificationsEmailConfig
26 webhook codersdk.NotificationsWebhookConfig
27 )
28
29 switch method {
30 case database.NotificationMethodSmtp:
31 smtp.Smarthost = serpent.String("localhost:1337")
32 case database.NotificationMethodWebhook:
33 webhook.Endpoint = serpent.URL(url.URL{Host: "localhost"})
34 }
35
36 return codersdk.NotificationsConfig{
37 Method: serpent.String(method),
38 MaxSendAttempts: 5,
39 FetchInterval: serpent.Duration(time.Millisecond * 100),
40 StoreSyncInterval: serpent.Duration(time.Millisecond * 200),
41 LeasePeriod: serpent.Duration(time.Second * 10),
42 DispatchTimeout: serpent.Duration(time.Second * 5),
43 RetryInterval: serpent.Duration(time.Millisecond * 50),
44 LeaseCount: 10,
45 StoreSyncBufferSize: 50,
46 SMTP: smtp,
47 Webhook: webhook,
48 Inbox: codersdk.NotificationsInboxConfig{
49 Enabled: serpent.Bool(true),
50 },
51 }
52}
53
54func defaultHelpers() map[string]any {
55 return map[string]any{

Callers 15

TestMetricsFunction · 0.85
TestPendingUpdatesMetricFunction · 0.85
TestSMTPDispatchFunction · 0.85
TestWebhookDispatchFunction · 0.85
TestBackpressureFunction · 0.85
TestRetriesFunction · 0.85
TestInvalidConfigFunction · 0.85
TestNotifierPausedFunction · 0.85

Calls 3

DurationMethod · 0.80
StringMethod · 0.45
URLMethod · 0.45

Tested by

no test coverage detected