ident: system identifier generator
This is pretty fast and guarantees uniqueness when initialised correctly. Signed-off-by: Yonah <contrib@gensokyo.uk>
This commit is contained in:
@@ -17,17 +17,13 @@ const (
|
||||
|
||||
// S represents a unique system identifier.
|
||||
type S struct {
|
||||
// Deployment site, typically denoting a datacenter servicing a region.
|
||||
Site uint32
|
||||
// Servicing host behind load balancer, unique within its Site.
|
||||
Host uint32
|
||||
|
||||
PartG
|
||||
// An instant in time, some time after the corresponding system metadata
|
||||
// first appeared to the backend, represented in nanoseconds since
|
||||
// 1970-01-01.
|
||||
Time uint64
|
||||
// Randomly generated value. The implementation must guarantee that the same
|
||||
// value cannot be emitted for a Time value on a servicing Host.
|
||||
// value cannot be emitted for a Time value on a servicing host.
|
||||
ID uint64
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user