41 lines
575 B
Go
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
|
|
}
|