v2/storagegroup: Implement uni-structure

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-08-17 12:08:11 +03:00 committed by Stanislav Bogatyrev
parent a3f0c5537c
commit 4b7f532e52

71
v2/storagegroup/types.go Normal file
View file

@ -0,0 +1,71 @@
package storagegroup
import (
"github.com/nspcc-dev/neofs-api-go/v2/refs"
)
type StorageGroup struct {
size uint64
hash []byte
exp uint64
members []*refs.ObjectID
}
func (s *StorageGroup) GetValidationDataSize() uint64 {
if s != nil {
return s.size
}
return 0
}
func (s *StorageGroup) SetValidationDataSize(v uint64) {
if s != nil {
s.size = v
}
}
func (s *StorageGroup) GetValidationHash() []byte {
if s != nil {
return s.hash
}
return nil
}
func (s *StorageGroup) SetValidationHash(v []byte) {
if s != nil {
s.hash = v
}
}
func (s *StorageGroup) GetExpirationEpoch() uint64 {
if s != nil {
return s.exp
}
return 0
}
func (s *StorageGroup) SetExpirationEpoch(v uint64) {
if s != nil {
s.exp = v
}
}
func (s *StorageGroup) GetMembers() []*refs.ObjectID {
if s != nil {
return s.members
}
return nil
}
func (s *StorageGroup) SetMembers(v []*refs.ObjectID) {
if s != nil {
s.members = v
}
}