Generate Spaceflake at time
kkrypt0nn opened this issue · comments
Krypton commented
Proposal
Be able to generate a Spaceflake where the base
or timestamp of that Spaceflake can be customized. The argument would be of type Time
and can be created with time.Date
. It would contain two generators, one on a Worker
type and another one with GeneratorSettings
added as argument.
When using a worker
func (w *Worker) GenerateSpaceflakeAt(at time.Time) (*Spaceflake, error) {
// ...
}
Without using a worker
func GenerateAt(s GeneratorSettings, at time.Time) (*Spaceflake, error) {
// ...
}