feat: publish standalone worker
Separate worker packaging and service lifecycle from the control plane.
Этот коммит содержится в:
29
internal/sender/count.go
Обычный файл
29
internal/sender/count.go
Обычный файл
@@ -0,0 +1,29 @@
|
||||
// Package sender provides functionality.
|
||||
package sender
|
||||
|
||||
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")
|
||||
}
|
||||
Ссылка в новой задаче
Block a user