Documentation
¶
Overview ¶
Package uuid provides a wrapper for handling UUID codes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // IsV1 is used to ensure value is a UUIDv1 IsV1 = versionRule{/* contains filtered or unexported fields */} // IsV4 confirms the UUID is version 4 IsV4 = versionRule{/* contains filtered or unexported fields */} )
Functions ¶
func SetRandomNodeID ¶
func SetRandomNodeID()
SetRandomNodeID is used to generate a random host ID to be used in V1 UUIDs instead of the MAC address. This is stored in the uuid library as a global constant, so should be called just once when starting the application if you're indending to generate V1 UUIDs to get a node ID that won't change.
func Within ¶
func Within(ttl time.Duration) validation.Rule
Within is a validation method that can be used to determine if the UUID corresponds do UUIDv1 standard and was timestamped within the acceptable time to live from now. If time checks are enabled, future UUIDs will not be allowed, this could be a problem.
Types ¶
type UUID ¶
UUID defines our wrapper for dealing with UUIDs
func (UUID) JSONSchema ¶ added in v0.17.0
func (UUID) JSONSchema() *jsonschema.Schema
JSONSchema returns the jsonschema schema object for the UUID.