Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var V4OnlyRegex = regexp.MustCompile(`^` + V4Regex.String() + `$`)
V4OnlyRegex matches a string containing only a valid v4 UUID
View Source
var V4Regex = regexp.MustCompile(`[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}`)
V4Regex matches a string containing a valid v4 UUID
Functions ¶
func SetGenerator ¶
func SetGenerator(generator Generator)
SetGenerator sets the generator used by UUID4()
Types ¶
type Generator ¶
type Generator interface {
Next() UUID
}
Generator is something that can generate a UUID
var DefaultGenerator Generator = defaultGenerator{}
DefaultGenerator is the default generator for calls to NewUUID
func NewSeededGenerator ¶
NewSeededGenerator creates a new seeded UUID4 generator from the given seed
Click to show internal directories.
Click to hide internal directories.