frostfs-api-go/tombstone/types.go
Evgenii Stratonikov 732dd51b1b [#388] *: Remove nil check from setters
I knew one day `sed` would save me an hour of manual work:
```
sed -i -n -e '
s/) Set/) Set/
p
t setter
b end
:setter
    n
    s/nil/nil/
    t hasif
    p
    b end
    :hasif
        n
        :loop
        p
        n
        s/}/}/
        t end
        b loop
        :end
' $@
goimports -w $@
```

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-31 11:32:04 +03:00

57 lines
1.1 KiB
Go

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
members []refs.ObjectID
}
// 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) {
s.exp = v
}
// 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) {
s.splitID = v
}
// GetMembers returns list of objects to be deleted.
func (s *Tombstone) GetMembers() []refs.ObjectID {
if s != nil {
return s.members
}
return nil
}
// SetMembers sets list of objects to be deleted.
func (s *Tombstone) SetMembers(v []refs.ObjectID) {
s.members = v
}