forked from TrueCloudLab/frostfs-api-go
[#168] acl: Implement binary/JSON encoders/decoders on BearerToken
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
d8fa8df442
commit
ec957be60c
6 changed files with 108 additions and 44 deletions
|
@ -468,3 +468,14 @@ func (bt *BearerToken) StableSize() (size int) {
|
|||
|
||||
return size
|
||||
}
|
||||
|
||||
func (bt *BearerToken) Unmarshal(data []byte) error {
|
||||
m := new(acl.BearerToken)
|
||||
if err := proto.Unmarshal(data, m); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*bt = *BearerTokenFromGRPCMessage(m)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue