ms-auth/internal/lib/lib.go
Vyacheslav1557 5af1a98b49 feat: init
2024-07-15 02:26:34 +05:00

41 lines
575 B
Go

package lib
import (
"time"
)
const (
RoleSpectator int32 = 0
RoleParticipant int32 = 1
RoleModerator int32 = 2
RoleAdmin int32 = 3
)
func IsAdmin(role int32) bool {
return role == RoleAdmin
}
func IsModerator(role int32) bool {
return role == RoleModerator
}
func IsParticipant(role int32) bool {
return role == RoleParticipant
}
func IsSpectator(role int32) bool {
return role == RoleSpectator
}
func AsTimeP(t time.Time) *time.Time {
return &t
}
func AsInt32P(v int32) *int32 {
return &v
}
func AsStringP(str string) *string {
return &str
}