frostfs-sdk-go/api/tombstone/test/generate.go
Pavel Pogodaev 6ce73790ea [#276] Merge repo with frostfs-api-go
Signed-off-by: Pavel Pogodaev <p.pogodaev@yadro.com>
2024-10-22 14:05:12 +00:00

23 lines
448 B
Go

package tombstonetest
import (
"crypto/rand"
refstest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/refs/test"
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/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
}