/internal/domain/fingerprint.go
Go | 18 lines | 12 code | 4 blank | 2 comment | 2 complexity | 15f7a1d71ebe7a2da72d3dc0d595ed49 MD5 | raw file
Possible License(s): BSD-2-Clause, MIT, JSON, 0BSD, BSD-3-Clause, Apache-2.0, MPL-2.0-no-copyleft-exception
- package domain
- import "regexp"
- var fingerprint = regexp.MustCompile(`(?i:^[0-9A-F]{32,64}$)`)
- // Fingerprint represents a fingerprint of a user.
- type Fingerprint struct {
- ID int64
- Session UUID
- Marker string
- CreatedAt string
- }
- // IsValid returns true if the Fingerprint contains valid value.
- func (f Fingerprint) IsValid() bool {
- return f.Marker != "" && fingerprint.MatchString(f.Marker)
- }