zitadel/internal/domain/user.go

29 lines
451 B
Go
Raw Normal View History

package domain
type User interface {
GetUsername() string
GetState() UserState
}
type UserState int32
const (
UserStateUnspecified UserState = iota
UserStateActive
UserStateInactive
UserStateDeleted
UserStateLocked
UserStateSuspend
UserStateInitial
userStateCount
)
func (f UserState) Valid() bool {
return f >= 0 && f < userStateCount
}
func (s UserState) Exists() bool {
return s != UserStateUnspecified && s != UserStateDeleted
}