예제 #1
0
func (db *Store) TimeTravelReverseId(t time.Time) flake.Id {
	duration := flake.MaxTime.Sub(t)
	reverseTime := time.Unix(int64(duration.Seconds()), 0)
	gen := flake.NewGeneratorFromTime(reverseTime)
	fid, _ := gen.NextId()
	return fid
}
예제 #2
0
func (db *Store) TimeTravelId(t time.Time) flake.Id {
	gen := flake.NewGeneratorFromTime(t)
	fid, _ := gen.NextId()
	return fid
}