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 удалений

34
internal/notifyrender/count.go Обычный файл
Просмотреть файл

@@ -0,0 +1,34 @@
// Package notifyrender owns the subject/body templates used by both the
// legacy sender (internal/sender) and the worker-driven notification
// producer (internal/notifier). It is a leaf package so the notifier package
// can pre-render notification content for the worker without importing the
// sender package, which would otherwise create an import cycle (sender's
// tests already import notifier to drive the legacy loop).
package notifyrender
import (
"log"
"strconv"
"rsgit.ru/rsmon/rsmon/config/translator"
)
// GetCount provides functionality.
func GetCount(count int, kind string) string {
tr, err := translator.Translator.C(kind, float64(count), 0, strconv.Itoa(count))
if err != nil {
log.Println("translator error", err)
return "монитор"
}
return tr
}
// GetDownMany provides functionality.
func GetDownMany(count int) string {
return "Не " + GetCount(count, "monitor")
}
// GetUpMany provides functionality.
func GetUpMany(count int) string {
return "Снова " + GetCount(count, "monitor")
}