forked from TrueCloudLab/frostfs-api-go
[#302] pkg/object: Document default values set in NewTombstone
Document field values of instance constructed via `NewTombstone`. Assert the values in corresponding unit test. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
753402c336
commit
2fb67d99d3
2 changed files with 30 additions and 0 deletions
|
@ -16,10 +16,22 @@ func NewTombstoneFromV2(tV2 *tombstone.Tombstone) *Tombstone {
|
|||
}
|
||||
|
||||
// NewTombstone creates and initializes blank Tombstone.
|
||||
//
|
||||
// Defaults:
|
||||
// - exp: 0;
|
||||
// - splitID: nil;
|
||||
// - members: nil.
|
||||
func NewTombstone() *Tombstone {
|
||||
return NewTombstoneFromV2(new(tombstone.Tombstone))
|
||||
}
|
||||
|
||||
// ToV2 converts Tombstone to v2 Tombstone message.
|
||||
//
|
||||
// Nil Tombstone converts to nil.
|
||||
func (ts *Tombstone) ToV2() *tombstone.Tombstone {
|
||||
return (*tombstone.Tombstone)(ts)
|
||||
}
|
||||
|
||||
// ExpirationEpoch return number of tombstone expiration epoch.
|
||||
func (t *Tombstone) ExpirationEpoch() uint64 {
|
||||
return (*tombstone.Tombstone)(t).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue