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

31
app/models/bits.go Обычный файл
Просмотреть файл

@@ -0,0 +1,31 @@
package models
import "time"
// BeginningOfDay provides functionality.
func BeginningOfDay(t time.Time) time.Time {
year, month, day := t.Date()
return time.Date(year, month, day, 0, 0, 0, 0, t.Location())
}
// SetBit provides functionality.
// https://stackoverflow.com/questions/23192262/how-would-you-set-and-clear-a-single-bit-in-go
// Sets the bit at pos in the integer n.
func SetBit(n int, pos uint) int {
n |= (1 << pos)
return n
}
// ClearBit provides functionality.
// Clears the bit at pos in n.
func ClearBit(n int, pos uint) int {
mask := ^(1 << pos)
n &= mask
return n
}
// HasBit provides functionality.
func HasBit(n int, pos uint) bool {
val := n & (1 << pos)
return (val > 0)
}