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
|
@ -77,6 +77,26 @@ func (x *Signature) SetSign(v []byte) {
|
|||
}
|
||||
}
|
||||
|
||||
// SetScheme sets signature scheme.
|
||||
func (x *Signature) SetScheme(s SignatureScheme) {
|
||||
if x != nil {
|
||||
x.Scheme = s
|
||||
}
|
||||
}
|
||||
|
||||
// FromString parses SignatureScheme from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *SignatureScheme) FromString(s string) bool {
|
||||
i, ok := SignatureScheme_value[s]
|
||||
if ok {
|
||||
*x = SignatureScheme(i)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// FromString parses ChecksumType from a string representation,
|
||||
// It is a reverse action to String().
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue