forked from TrueCloudLab/frostfs-api-go
[#55] refs: Add Scheme field to Signature
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
66e1fb8c53
commit
a4349f6692
10 changed files with 252 additions and 85 deletions
|
@ -24,3 +24,24 @@ func (t *ChecksumType) FromString(s string) bool {
|
|||
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue