Files
grafana/pkg/storage/unified/resource/rv.go
2024-07-03 08:59:09 -07:00

17 lines
448 B
Go

package resource
import "sync/atomic"
// The kubernetes storage.Interface tests expect this to be a sequential progression
// SnowflakeIDs do not pass the off-the-shelf k8s tests, although they provide totally
// acceptable values.
type NextResourceVersion = func() int64
func newResourceVersionCounter(start int64) NextResourceVersion {
var counter atomic.Int64
_ = counter.Swap(start + 1)
return func() int64 {
return counter.Add(1)
}
}