forked from TrueCloudLab/frostfs-api-go
[#231] object: Implement string encode/decode methods on Type
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
0f04087543
commit
53e2756762
3 changed files with 50 additions and 0 deletions
|
@ -33,3 +33,14 @@ func TypeFromV2(t object.Type) Type {
|
|||
return TypeRegular
|
||||
}
|
||||
}
|
||||
|
||||
func (t Type) String() string {
|
||||
return t.ToV2().String()
|
||||
}
|
||||
|
||||
// TypeFromString parses Type from its string representation.
|
||||
func TypeFromString(s string) Type {
|
||||
return TypeFromV2(
|
||||
object.TypeFromString(s),
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue