frostfs-api-go/tombstone/test/generate.go

24 lines
446 B
Go
Raw Normal View History

package tombstonetest
import (
"crypto/rand"
refstest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/test"
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/tombstone"
)
func GenerateTombstone(empty bool) *tombstone.Tombstone {
m := new(tombstone.Tombstone)
if !empty {
id := make([]byte, 16)
_, _ = rand.Read(id)
m.SetExpirationEpoch(89)
m.SetSplitID(id)
m.SetMembers(refstest.GenerateObjectIDs(false))
}
return m
}