Documentation ¶
Overview ¶
Package guid implements a thread-safe ID generator. The returned ID will be unique for a given process, but will not be globally unique. This is because it uses the system clock and a sequence.
The ID returned is YYYYMMDD-HH24MI-SSSS-SSSS-NNNNNNNNNNNN, where the date is UTC and N is a zero-padded sequence that starts at zero.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator holds our lock and current value.
func New ¶
New returns a new generator starting at the sequence. It's useful if you're interested in restoring a generator.
Click to show internal directories.
Click to hide internal directories.