forked from TrueCloudLab/frostfs-api-go
[#168] acl: Implement binary/JSON encoders/decoders on Target
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
7f42156201
commit
9ddc4c1f48
6 changed files with 127 additions and 4 deletions
|
@ -278,6 +278,17 @@ func (t *Target) StableSize() (size int) {
|
|||
return size
|
||||
}
|
||||
|
||||
func (t *Target) Unmarshal(data []byte) error {
|
||||
m := new(acl.EACLRecord_Target)
|
||||
if err := proto.Unmarshal(data, m); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*t = *TargetInfoFromGRPCMessage(m)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *TokenLifetime) StableMarshal(buf []byte) ([]byte, error) {
|
||||
if l == nil {
|
||||
return []byte{}, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue