Skip to content

Commit 778e5fa

Browse files
committed
Switch to icinga-go-library
1 parent b6b4a75 commit 778e5fa

File tree

32 files changed

+126
-155
lines changed

32 files changed

+126
-155
lines changed

cmd/channel/email/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88
"github.com/emersion/go-sasl"
99
"github.com/emersion/go-smtp"
1010
"github.com/google/uuid"
11+
"github.com/icinga/icinga-go-library/types"
1112
"github.com/icinga/icinga-notifications/internal"
1213
"github.com/icinga/icinga-notifications/pkg/plugin"
13-
"github.com/icinga/icingadb/pkg/types"
1414
"github.com/jhillyerd/enmime"
1515
"net"
1616
"net/mail"

cmd/icinga-notifications-daemon/main.go

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ import (
44
"context"
55
"flag"
66
"fmt"
7+
"github.com/icinga/icinga-go-library/database"
8+
"github.com/icinga/icinga-go-library/logging"
9+
"github.com/icinga/icinga-go-library/utils"
710
"github.com/icinga/icinga-notifications/internal"
811
"github.com/icinga/icinga-notifications/internal/channel"
912
"github.com/icinga/icinga-notifications/internal/config"
1013
"github.com/icinga/icinga-notifications/internal/daemon"
1114
"github.com/icinga/icinga-notifications/internal/icinga2"
1215
"github.com/icinga/icinga-notifications/internal/incident"
1316
"github.com/icinga/icinga-notifications/internal/listener"
14-
"github.com/icinga/icingadb/pkg/logging"
15-
"github.com/icinga/icingadb/pkg/utils"
1617
"go.uber.org/zap"
1718
"os"
1819
"os/signal"
@@ -55,27 +56,20 @@ func main() {
5556

5657
conf := daemon.Config()
5758

58-
logs, err := logging.NewLogging(
59-
"icinga-notifications",
60-
conf.Logging.Level,
61-
conf.Logging.Output,
62-
conf.Logging.Options,
63-
conf.Logging.Interval,
64-
)
59+
logs, err := logging.NewLoggingFromConfig("icinga-notifications", conf.Logging)
6560
if err != nil {
66-
_, _ = fmt.Fprintln(os.Stderr, "cannot initialize logging:", err)
67-
os.Exit(1)
61+
utils.PrintErrorThenExit(err, 1)
6862
}
6963

7064
logger := logs.GetLogger()
7165
logger.Infof("Starting Icinga Notifications daemon (%s)", internal.Version.Version)
72-
db, err := conf.Database.Open(logs.GetChildLogger("database"))
66+
db, err := database.NewDbFromConfig(&conf.Database, logs.GetChildLogger("database"), database.RetryConnectorCallbacks{})
7367
if err != nil {
7468
logger.Fatalw("cannot create database connection from config", zap.Error(err))
7569
}
7670
defer db.Close()
7771
{
78-
logger.Infof("Connecting to database at '%s'", utils.JoinHostPort(conf.Database.Host, conf.Database.Port))
72+
logger.Infof("Connecting to database at '%s'", db.GetAddr())
7973
if err := db.Ping(); err != nil {
8074
logger.Fatalw("cannot connect to database", zap.Error(err))
8175
}

go.mod

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
module github.com/icinga/icinga-notifications
22

3-
go 1.21
3+
go 1.22
44

55
require (
66
github.com/creasty/defaults v1.7.0
77
github.com/emersion/go-sasl v0.0.0-20231106173351-e73c9f7bad43
88
github.com/emersion/go-smtp v0.21.2
99
github.com/goccy/go-yaml v1.11.3
1010
github.com/google/uuid v1.6.0
11-
github.com/icinga/icingadb v1.1.1-0.20230418113126-7c4b947aad3a
11+
github.com/icinga/icinga-go-library v0.1.1-0.20240529153148-5054d55f8005
1212
github.com/jhillyerd/enmime v1.2.0
1313
github.com/jmoiron/sqlx v1.4.0
1414
github.com/pkg/errors v0.9.1
@@ -22,11 +22,8 @@ require (
2222
require (
2323
filippo.io/edwards25519 v1.1.0 // indirect
2424
github.com/cention-sany/utf7 v0.0.0-20170124080048-26cad61bd60a // indirect
25-
github.com/cespare/xxhash/v2 v2.1.2 // indirect
2625
github.com/davecgh/go-spew v1.1.1 // indirect
27-
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
2826
github.com/fatih/color v1.13.0 // indirect
29-
github.com/go-redis/redis/v8 v8.11.5 // indirect
3027
github.com/go-sql-driver/mysql v1.8.1 // indirect
3128
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f // indirect
3229
github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056 // indirect
@@ -41,7 +38,7 @@ require (
4138
github.com/ssgreg/journald v1.0.0 // indirect
4239
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
4340
go.uber.org/multierr v1.10.0 // indirect
44-
golang.org/x/exp v0.0.0-20220613132600-b0d781184e0d // indirect
41+
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
4542
golang.org/x/net v0.23.0 // indirect
4643
golang.org/x/sys v0.20.0 // indirect
4744
golang.org/x/text v0.15.0 // indirect

go.sum

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,23 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
22
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
33
github.com/cention-sany/utf7 v0.0.0-20170124080048-26cad61bd60a h1:MISbI8sU/PSK/ztvmWKFcI7UGb5/HQT7B+i3a2myKgI=
44
github.com/cention-sany/utf7 v0.0.0-20170124080048-26cad61bd60a/go.mod h1:2GxOXOlEPAMFPfp014mK1SWq8G8BN8o7/dfYqJrVGn8=
5-
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
6-
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
75
github.com/creasty/defaults v1.7.0 h1:eNdqZvc5B509z18lD8yc212CAqJNvfT1Jq6L8WowdBA=
86
github.com/creasty/defaults v1.7.0/go.mod h1:iGzKe6pbEHnpMPtfDXZEr0NVxWnPTjb1bbDy08fPzYM=
97
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
108
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
11-
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
12-
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
139
github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21/go.mod h1:iL2twTeMvZnrg54ZoPDNfJaJaqy0xIQFuBdrLsmspwQ=
1410
github.com/emersion/go-sasl v0.0.0-20231106173351-e73c9f7bad43 h1:hH4PQfOndHDlpzYfLAAfl63E8Le6F2+EL/cdhlkyRJY=
1511
github.com/emersion/go-sasl v0.0.0-20231106173351-e73c9f7bad43/go.mod h1:iL2twTeMvZnrg54ZoPDNfJaJaqy0xIQFuBdrLsmspwQ=
1612
github.com/emersion/go-smtp v0.21.2 h1:OLDgvZKuofk4em9fT5tFG5j4jE1/hXnX75UMvcrL4AA=
1713
github.com/emersion/go-smtp v0.21.2/go.mod h1:qm27SGYgoIPRot6ubfQ/GpiPy/g3PaZAVRxiO/sDUgQ=
1814
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
1915
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
20-
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
21-
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
2216
github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
2317
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
2418
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
2519
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
2620
github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE=
2721
github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4=
28-
github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=
29-
github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo=
3022
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
3123
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
3224
github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg=
@@ -35,12 +27,12 @@ github.com/goccy/go-yaml v1.11.3 h1:B3W9IdWbvrUu2OYQGwvU1nZtvMQJPBKgBUuweJjLj6I=
3527
github.com/goccy/go-yaml v1.11.3/go.mod h1:wKnAMd44+9JAAnGQpWVEgBzGt3YuTaQ4uXoHvE4m7WU=
3628
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f h1:3BSP1Tbs2djlpprl7wCLuiqMaUh5SJkkzI2gDs+FgLs=
3729
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14=
38-
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
39-
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
30+
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
31+
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
4032
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
4133
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
42-
github.com/icinga/icingadb v1.1.1-0.20230418113126-7c4b947aad3a h1:NfVdBKa4dhPk7IU8u0MOF6ywi0LDpMkQMGs1j803+3c=
43-
github.com/icinga/icingadb v1.1.1-0.20230418113126-7c4b947aad3a/go.mod h1:zamCKaKn4JJQinctcUyewTSNNXDfpLc0HSbqb+9lTYs=
34+
github.com/icinga/icinga-go-library v0.1.1-0.20240529153148-5054d55f8005 h1:YYjW1LFdzOYUNf1hPo9PqfReRD1dH2UdWZ9V4t3vygc=
35+
github.com/icinga/icinga-go-library v0.1.1-0.20240529153148-5054d55f8005/go.mod h1:YN7XJN3W0FodD+j4kirO89zk2tgvanXWt1RMV8UgOLo=
4436
github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056 h1:iCHtR9CQyktQ5+f3dMVZfwD2KWJUgm7M0gdL9NGr8KA=
4537
github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056/go.mod h1:CVKlgaMiht+LXvHG173ujK6JUhZXKb2u/BQtjPDIvyk=
4638
github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc=
@@ -65,14 +57,8 @@ github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZ
6557
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
6658
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
6759
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
68-
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
69-
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
7060
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
7161
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
72-
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
73-
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
74-
github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
75-
github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
7662
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
7763
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
7864
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -96,8 +82,8 @@ go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
9682
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
9783
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
9884
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
99-
golang.org/x/exp v0.0.0-20220613132600-b0d781184e0d h1:vtUKgx8dahOomfFzLREU8nSv25YHnTgLBn4rDnWZdU0=
100-
golang.org/x/exp v0.0.0-20220613132600-b0d781184e0d/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA=
85+
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM=
86+
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc=
10187
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
10288
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
10389
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
@@ -115,9 +101,5 @@ golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3j
115101
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
116102
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
117103
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
118-
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
119-
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
120-
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
121-
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
122104
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
123105
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

internal/channel/channel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type Channel struct {
1818
Type string `db:"type"`
1919
Config string `db:"config" json:"-"` // excluded from JSON config dump as this may contain sensitive information
2020

21-
Logger *zap.SugaredLogger
21+
Logger *zap.SugaredLogger `db:"-"`
2222

2323
restartCh chan newConfig
2424
pluginCh chan *Plugin

internal/channel/plugin.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import (
44
"bufio"
55
"encoding/json"
66
"fmt"
7+
"github.com/icinga/icinga-go-library/database"
8+
"github.com/icinga/icinga-go-library/logging"
79
"github.com/icinga/icinga-notifications/internal/daemon"
810
"github.com/icinga/icinga-notifications/pkg/plugin"
911
"github.com/icinga/icinga-notifications/pkg/rpc"
10-
"github.com/icinga/icingadb/pkg/icingadb"
11-
"github.com/icinga/icingadb/pkg/logging"
1212
"go.uber.org/zap"
1313
"io"
1414
"os"
@@ -166,7 +166,7 @@ func forwardLogs(errPipe io.Reader, logger *zap.SugaredLogger) {
166166
}
167167

168168
// UpsertPlugins upsert the available_channel_type table with working plugins
169-
func UpsertPlugins(channelPluginDir string, logger *logging.Logger, db *icingadb.DB) {
169+
func UpsertPlugins(channelPluginDir string, logger *logging.Logger, db *database.DB) {
170170
logger.Debug("Updating available channel types")
171171
files, err := os.ReadDir(channelPluginDir)
172172
if err != nil {

internal/config/rule.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"context"
55
"github.com/icinga/icinga-notifications/internal/filter"
66
"github.com/icinga/icinga-notifications/internal/rule"
7-
"github.com/icinga/icinga-notifications/internal/utils"
87
"github.com/jmoiron/sqlx"
98
"go.uber.org/zap"
9+
"slices"
1010
)
1111

1212
func (r *RuntimeConfig) fetchRules(ctx context.Context, tx *sqlx.Tx) error {
@@ -188,7 +188,9 @@ func (r *RuntimeConfig) applyPendingRules() {
188188
}
189189
}
190190

191-
escalation.Recipients = utils.RemoveNils(escalation.Recipients)
191+
escalation.Recipients = slices.DeleteFunc(escalation.Recipients, func(r *rule.EscalationRecipient) bool {
192+
return r == nil
193+
})
192194
}
193195

194196
if currentRule := r.Rules[id]; currentRule != nil {

internal/config/runtime.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import (
44
"context"
55
"database/sql"
66
"errors"
7+
"github.com/icinga/icinga-go-library/database"
8+
"github.com/icinga/icinga-go-library/logging"
79
"github.com/icinga/icinga-notifications/internal/channel"
810
"github.com/icinga/icinga-notifications/internal/recipient"
911
"github.com/icinga/icinga-notifications/internal/rule"
1012
"github.com/icinga/icinga-notifications/internal/timeperiod"
11-
"github.com/icinga/icingadb/pkg/icingadb"
12-
"github.com/icinga/icingadb/pkg/logging"
1313
"github.com/jmoiron/sqlx"
1414
"go.uber.org/zap"
1515
"golang.org/x/crypto/bcrypt"
@@ -34,7 +34,7 @@ type RuntimeConfig struct {
3434

3535
logs *logging.Logging
3636
logger *logging.Logger
37-
db *icingadb.DB
37+
db *database.DB
3838

3939
// mu is used to synchronize access to the live ConfigSet.
4040
mu sync.RWMutex
@@ -43,7 +43,7 @@ type RuntimeConfig struct {
4343
func NewRuntimeConfig(
4444
esLaunch func(source *Source),
4545
logs *logging.Logging,
46-
db *icingadb.DB,
46+
db *database.DB,
4747
) *RuntimeConfig {
4848
return &RuntimeConfig{
4949
EventStreamLaunchFunc: esLaunch,

internal/config/source.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package config
22

33
import (
44
"context"
5-
"github.com/icinga/icingadb/pkg/types"
5+
"github.com/icinga/icinga-go-library/types"
66
"github.com/jmoiron/sqlx"
77
"go.uber.org/zap"
88
)

internal/config/timeperiod.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"context"
55
"database/sql"
66
"fmt"
7+
"github.com/icinga/icinga-go-library/types"
78
"github.com/icinga/icinga-notifications/internal/timeperiod"
8-
"github.com/icinga/icingadb/pkg/types"
99
"github.com/jmoiron/sqlx"
1010
"go.uber.org/zap"
1111
"time"

0 commit comments

Comments
 (0)