frostfs-sdk-go/api/refs/string.go
Pavel Pogodaev 6693b47366
Some checks failed
DCO / DCO (pull_request) Successful in 54s
Tests and linters / Tests (pull_request) Failing after 1m12s
Tests and linters / Lint (pull_request) Successful in 1m32s
[#276] Merge repo with frostfs-api-go
Signed-off-by: Pavel Pogodaev <p.pogodaev@yadro.com>
2024-10-08 14:53:40 +03:00

47 lines
1,004 B
Go

package refs
import (
refs "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/grpc"
)
// 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
}
// 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
}