Total Lines | 13 |
Duplicated Lines | 0 % |
Changes | 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 |