2020-12-10 08:30:14 +00:00
|
|
|
package tombstone
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neofs-api-go/v2/refs"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Tombstone is a unified structure of Tombstone
|
|
|
|
// message from proto definition.
|
|
|
|
type Tombstone struct {
|
|
|
|
exp uint64
|
|
|
|
|
|
|
|
splitID []byte
|
|
|
|
|
2022-03-01 12:50:09 +00:00
|
|
|
members []refs.ObjectID
|
2020-12-10 08:30:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetExpirationEpoch returns number of tombstone expiration epoch.
|
|
|
|
func (s *Tombstone) GetExpirationEpoch() uint64 {
|
|
|
|
if s != nil {
|
|
|
|
return s.exp
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetExpirationEpoch sets number of tombstone expiration epoch.
|
|
|
|
func (s *Tombstone) SetExpirationEpoch(v uint64) {
|
2022-03-23 11:42:57 +00:00
|
|
|
s.exp = v
|
2020-12-10 08:30:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetSplitID returns identifier of split object hierarchy.
|
|
|
|
func (s *Tombstone) GetSplitID() []byte {
|
|
|
|
if s != nil {
|
|
|
|
return s.splitID
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetSplitID sets identifier of split object hierarchy.
|
|
|
|
func (s *Tombstone) SetSplitID(v []byte) {
|
2022-03-23 11:42:57 +00:00
|
|
|
s.splitID = v
|
2020-12-10 08:30:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetMembers returns list of objects to be deleted.
|
2022-03-01 12:50:09 +00:00
|
|
|
func (s *Tombstone) GetMembers() []refs.ObjectID {
|
2020-12-10 08:30:14 +00:00
|
|
|
if s != nil {
|
|
|
|
return s.members
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetMembers sets list of objects to be deleted.
|
2022-03-01 12:50:09 +00:00
|
|
|
func (s *Tombstone) SetMembers(v []refs.ObjectID) {
|
2022-03-23 11:42:57 +00:00
|
|
|
s.members = v
|
2020-12-10 08:30:14 +00:00
|
|
|
}
|