2021-06-18 12:27:01 +00:00
|
|
|
package refs
|
|
|
|
|
|
|
|
import (
|
2023-03-07 10:38:56 +00:00
|
|
|
refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
2021-06-18 12:27:01 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// String returns string representation of ChecksumType.
|
|
|
|
func (t ChecksumType) String() string {
|
|
|
|
return ChecksumTypeToGRPC(t).String()
|
|
|
|
}
|
|
|
|
|
|
|
|
// FromString parses ChecksumType from a string representation.
|
|
|
|
// It is a reverse action to String().
|
|
|
|
//
|
|
|
|
// Returns true if s was parsed successfully.
|
|
|
|
func (t *ChecksumType) FromString(s string) bool {
|
|
|
|
var g refs.ChecksumType
|
|
|
|
|
|
|
|
ok := g.FromString(s)
|
|
|
|
|
|
|
|
if ok {
|
|
|
|
*t = ChecksumTypeFromGRPC(g)
|
|
|
|
}
|
|
|
|
|
|
|
|
return ok
|
|
|
|
}
|
2022-02-22 11:25:43 +00:00
|
|
|
|
|
|
|
// String returns string representation of SignatureScheme.
|
|
|
|
func (t SignatureScheme) String() string {
|
|
|
|
return refs.SignatureScheme(t).String()
|
|
|
|
}
|
|
|
|
|
|
|
|
// FromString parses SignatureScheme from a string representation.
|
|
|
|
// It is a reverse action to String().
|
|
|
|
//
|
|
|
|
// Returns true if s was parsed successfully.
|
|
|
|
func (t *SignatureScheme) FromString(s string) bool {
|
|
|
|
var g refs.SignatureScheme
|
|
|
|
|
|
|
|
ok := g.FromString(s)
|
|
|
|
|
|
|
|
if ok {
|
|
|
|
*t = SignatureScheme(g)
|
|
|
|
}
|
|
|
|
|
|
|
|
return ok
|
|
|
|
}
|