feat: publish standalone worker

Separate worker packaging and service lifecycle from the control plane.
Этот коммит содержится в:
Gleb Tv
2026-07-13 17:55:14 +03:00
Коммит 2c7a0236da
309 изменённых файлов: 44004 добавлений и 0 удалений

63
spec/factories/messages.go Обычный файл
Просмотреть файл

@@ -0,0 +1,63 @@
package factories
import (
"time"
"github.com/lib/pq"
"rsgit.ru/rsmon/rsmon/app/models"
)
// MessageFactory provides functionality.
func MessageFactory() models.Message {
ts := time.Date(2019, time.January, 3, 3, 4, 4, 0, time.UTC)
monitor := MonitorFactory(nil, "test monitor")
check := CheckFactory(&monitor, "http")
e := "testerr"
check.Error = &e
event := models.Event{
Monitor: &monitor,
StartTime: &ts,
EndTime: nil,
Duration: 60,
Errors: 3,
Oks: 0,
State: "current",
Reason: "test error",
ChecksDown: pq.StringArray{check.Kind},
Checks: []models.Check{
check,
},
}
message := models.Message{
Contact: &models.Contact{
Kind: "email",
},
Kind: "down",
Events: []models.Event{
event,
},
}
return message
}
// ExpMessageFactory provides functionality.
func ExpMessageFactory() models.Message {
monitor := MonitorFactory(nil, "test monitor")
check := CheckFactory(&monitor, "http")
message := models.Message{
Contact: &models.Contact{
Kind: "email",
},
Kind: "exp",
Check: &check,
}
return message
}