forked from TrueCloudLab/frostfs-api-go
[#417] storagegroup: Mark all expiration methods as deprecated
`expiration_epoch` field of `StorageGroup` message has been marked as deprecated in previous NeoFS API protocol's release. Mark all method related to the field as deprecated. Leave and use them for test purposes only. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>support/v2.15
parent
cf868188ef
commit
49bf6b24b0
|
@ -15,6 +15,7 @@ func (s *StorageGroup) ToGRPCMessage() grpc.Message {
|
||||||
m = new(sg.StorageGroup)
|
m = new(sg.StorageGroup)
|
||||||
|
|
||||||
m.SetMembers(refs.ObjectIDListToGRPCMessage(s.members))
|
m.SetMembers(refs.ObjectIDListToGRPCMessage(s.members))
|
||||||
|
//nolint:staticcheck
|
||||||
m.SetExpirationEpoch(s.exp)
|
m.SetExpirationEpoch(s.exp)
|
||||||
m.SetValidationDataSize(s.size)
|
m.SetValidationDataSize(s.size)
|
||||||
m.SetValidationHash(s.hash.ToGRPCMessage().(*refsGRPC.Checksum))
|
m.SetValidationHash(s.hash.ToGRPCMessage().(*refsGRPC.Checksum))
|
||||||
|
@ -50,7 +51,7 @@ func (s *StorageGroup) FromGRPCMessage(m grpc.Message) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
//nolint: staticcheck
|
//nolint:staticcheck
|
||||||
s.exp = v.GetExpirationEpoch()
|
s.exp = v.GetExpirationEpoch()
|
||||||
s.size = v.GetValidationDataSize()
|
s.size = v.GetValidationDataSize()
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,8 @@ func (m *StorageGroup) SetValidationHash(v *refs.Checksum) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetExpirationEpoch sets number of the last epoch of the storage group lifetime.
|
// SetExpirationEpoch sets number of the last epoch of the storage group lifetime.
|
||||||
|
//
|
||||||
|
// Deprecated: do not use, `expiration_epoch` field is deprecated in protocol.
|
||||||
func (m *StorageGroup) SetExpirationEpoch(v uint64) {
|
func (m *StorageGroup) SetExpirationEpoch(v uint64) {
|
||||||
m.ExpirationEpoch = v
|
m.ExpirationEpoch = v
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ func GenerateStorageGroup(empty bool) *storagegroup.StorageGroup {
|
||||||
|
|
||||||
if !empty {
|
if !empty {
|
||||||
m.SetValidationDataSize(44)
|
m.SetValidationDataSize(44)
|
||||||
|
//nolint:staticcheck
|
||||||
m.SetExpirationEpoch(55)
|
m.SetExpirationEpoch(55)
|
||||||
m.SetMembers(refstest.GenerateObjectIDs(false))
|
m.SetMembers(refstest.GenerateObjectIDs(false))
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,8 @@ func (s *StorageGroup) SetValidationHash(v *refs.Checksum) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetExpirationEpoch of unified storage group structure.
|
// GetExpirationEpoch of unified storage group structure.
|
||||||
|
//
|
||||||
|
// Deprecated: Do not use.
|
||||||
func (s *StorageGroup) GetExpirationEpoch() uint64 {
|
func (s *StorageGroup) GetExpirationEpoch() uint64 {
|
||||||
if s != nil {
|
if s != nil {
|
||||||
return s.exp
|
return s.exp
|
||||||
|
@ -54,6 +56,8 @@ func (s *StorageGroup) GetExpirationEpoch() uint64 {
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetExpirationEpoch into unified storage group structure.
|
// SetExpirationEpoch into unified storage group structure.
|
||||||
|
//
|
||||||
|
// Deprecated: Do not use.
|
||||||
func (s *StorageGroup) SetExpirationEpoch(v uint64) {
|
func (s *StorageGroup) SetExpirationEpoch(v uint64) {
|
||||||
s.exp = v
|
s.exp = v
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue