Files
worker/internal/notifyrender/count.go
Gleb Tv 2c884c5612
Некоторые проверки не удались
CI / test (push) Successful in 2m5s
Docker / Build and publish worker image (push) Failing after 31s
refactor: adopt worker module path
2026-07-13 17:56:12 +03:00

35 строки
1.0 KiB
Go

// 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"
"rocketgit.ru/rsmon/worker/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")
}