|
@@ -2,6 +2,7 @@ package idgen |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"sync" |
|
|
"sync" |
|
|
|
|
|
"time" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
var singletonMutex sync.Mutex |
|
|
var singletonMutex sync.Mutex |
|
@@ -27,3 +28,7 @@ func NextId() int64 { |
|
|
|
|
|
|
|
|
return idGenerator.NewLong() |
|
|
return idGenerator.NewLong() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func ExtractTime(id int64) time.Time { |
|
|
|
|
|
return idGenerator.ExtractTime(id) |
|
|
|
|
|
} |