ms-tester/internal/lib/lib.go

41 lines
575 B
Go
Raw Normal View History

2024-07-27 07:31:04 +00:00
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
}