From 4b7f532e526e5c518f59ce0e0ef0f2cca498a75a Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 17 Aug 2020 12:08:11 +0300 Subject: [PATCH] v2/storagegroup: Implement uni-structure Signed-off-by: Leonard Lyubich --- v2/storagegroup/types.go | 71 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 v2/storagegroup/types.go diff --git a/v2/storagegroup/types.go b/v2/storagegroup/types.go new file mode 100644 index 0000000..38a09f2 --- /dev/null +++ b/v2/storagegroup/types.go @@ -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 + } +}