53e2756762
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
29 lines
526 B
Go
29 lines
526 B
Go
package object
|
|
|
|
const (
|
|
typeRegularString = "Regular"
|
|
typeTombstoneString = "Tombstone"
|
|
typeStorageGroupString = "StorageGroup"
|
|
)
|
|
|
|
func (t Type) String() string {
|
|
switch t {
|
|
default:
|
|
return typeRegularString
|
|
case TypeTombstone:
|
|
return typeTombstoneString
|
|
case TypeStorageGroup:
|
|
return typeStorageGroupString
|
|
}
|
|
}
|
|
|
|
func TypeFromString(s string) Type {
|
|
switch s {
|
|
default:
|
|
return TypeRegular
|
|
case typeTombstoneString:
|
|
return TypeTombstone
|
|
case typeStorageGroupString:
|
|
return TypeStorageGroup
|
|
}
|
|
}
|