Add v2
version to go module name
Replace all elements from `v2` to root directory. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
2d70391e31
commit
25da5d2e13
267 changed files with 116 additions and 17991 deletions
55
object/string.go
Normal file
55
object/string.go
Normal file
|
@ -0,0 +1,55 @@
|
|||
package object
|
||||
|
||||
import (
|
||||
object "github.com/nspcc-dev/neofs-api-go/v2/object/grpc"
|
||||
)
|
||||
|
||||
// String returns string representation of Type.
|
||||
func (t Type) String() string {
|
||||
return TypeToGRPCField(t).String()
|
||||
}
|
||||
|
||||
// FromString parses Type from a string representation.
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (t *Type) FromString(s string) bool {
|
||||
var g object.ObjectType
|
||||
|
||||
ok := g.FromString(s)
|
||||
|
||||
if ok {
|
||||
*t = TypeFromGRPCField(g)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// TypeFromString converts string to Type.
|
||||
//
|
||||
// Deprecated: use FromString method.
|
||||
func TypeFromString(s string) (t Type) {
|
||||
t.FromString(s)
|
||||
return
|
||||
}
|
||||
|
||||
// String returns string representation of MatchType.
|
||||
func (t MatchType) String() string {
|
||||
return MatchTypeToGRPCField(t).String()
|
||||
}
|
||||
|
||||
// FromString parses MatchType from a string representation.
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (t *MatchType) FromString(s string) bool {
|
||||
var g object.MatchType
|
||||
|
||||
ok := g.FromString(s)
|
||||
|
||||
if ok {
|
||||
*t = MatchTypeFromGRPCField(g)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue