github.com/TykTechnologies/tyk/internal/uuid
No package summary is available.
Package
Files: 1. Third party imports: 1. Imports from organisation: 0. Tests: 0. Benchmarks: 0.
Functions
func New
New returns a V4 UUID.
func New() string {
id, err := uuid.NewV4()
checkErrAndPanic(err, "Error generating UUID")
return id.String()
}
Cognitive complexity: 0, Cyclomatic complexity: 1
func NewHex
NewHex returns a V4 UUID without dashes.
func NewHex() string {
return strings.ReplaceAll(New(), "-", "")
}
Cognitive complexity: 0, Cyclomatic complexity: 1
func Valid
Valid returns true if id is parsed as UUID without error.
func Valid(id string) bool {
_, err := uuid.FromString(id)
return err == nil
}
Cognitive complexity: 0, Cyclomatic complexity: 1
Private functions
func checkErrAndPanic
checkErrAndPanic (err error, message string)
Tests
Files: 1. Third party imports: 1. Imports from organisation: 0. Tests: 2. Benchmarks: 0.