mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 19:44:21 +00:00
24 lines
309 B
Go
24 lines
309 B
Go
|
package model
|
||
|
|
||
|
type state int32
|
||
|
|
||
|
func (s state) String() string {
|
||
|
return states[s]
|
||
|
}
|
||
|
|
||
|
const (
|
||
|
Active state = iota
|
||
|
Inactive
|
||
|
)
|
||
|
|
||
|
func ProjectStateToInt(s ProjectState) int32 {
|
||
|
if s == nil {
|
||
|
return 0
|
||
|
}
|
||
|
return int32(s.(state))
|
||
|
}
|
||
|
|
||
|
func ProjectStateFromInt(index int32) ProjectState {
|
||
|
return state(index)
|
||
|
}
|