Completed
Push — main ( 788e73...fbce6d )
by Igor
28s queued 12s
created

it.IsULID   A

Complexity

Conditions 1

Size

Total Lines 4
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
dl 0
loc 4
rs 10
c 0
b 0
f 0
nop 0
1
package it
2
3
import (
4
	"github.com/muonsoft/validation"
5
	"github.com/muonsoft/validation/is"
6
)
7
8
// IsULID validates whether the value is a valid ULID (Universally Unique Lexicographically Sortable Identifier).
9
// See https://github.com/ulid/spec for ULID specifications.
10
func IsULID() validation.StringFuncConstraint {
11
	return validation.OfStringBy(is.ULID).
12
		WithError(validation.ErrInvalidULID).
13
		WithMessage(validation.ErrInvalidULID.Message())
14
}
15