Versions in this module Expand all Collapse all v0 v0.1.0 Dec 4, 2026 Changes in this version + const KeyCVCInvalid + const KeyCardInvalid + const KeyChecksumInvalid + const KeyExpirationDateFormatInvalid + const KeyExpirationDateInvalid + const KeyExpirationMonthInvalid + const KeyExpirationYearInvalid + const KeyLengthInvalid + const KeyPatternInvalid + const Version + func ValidCVC(value any) bool + func ValidCVCFor(number, cvc any) bool + func ValidCVCLength(value any, lengths ...int) bool + func ValidExpiration(year, month any, now time.Time) bool + func ValidExpirationDate(value, format string, now time.Time) bool + type Brand struct + func BrandNamed(name string) (Brand, bool) + func Brands() []Brand + func Detect(value any) (Brand, bool) + func NewBrand(spec BrandSpec) (Brand, error) + func (b Brand) DisplayName() string + func (b Brand) Funding() Funding + func (b Brand) Name() string + func (b Brand) Parse(value any) (Card, error) + func (b Brand) String() string + func (b Brand) ValidCVC(value any) bool + type BrandSpec struct + CVCLengths []int + Checksum Checksum + DisplayName string + Funding Funding + Lengths []int + Name string + Pattern string + type Card struct + func Parse(value any) (Card, error) + func (c Card) Brand() Brand + func (c Card) GoString() string + func (c Card) String() string + type Checksum uint8 + const Luhn + const NoChecksum + type Error string + const ErrCVCConfig + const ErrCardNotFound + const ErrCharacters + const ErrChecksum + const ErrEmpty + const ErrFunding + const ErrInvalidType + const ErrLength + const ErrName + const ErrPattern + func (e Error) Error() string + type Funding string + const Credit + const Debit + type Rule struct + func CVC() Rule + func CVCFor(number any) Rule + func CVCFrom(path string) Rule + func ExpirationDate(phpFormat string) Rule + func ExpirationMonth() Rule + func ExpirationMonthFor(year any) Rule + func ExpirationMonthFrom(path string) Rule + func ExpirationYear() Rule + func ExpirationYearFor(month any) Rule + func ExpirationYearFrom(path string) Rule + func Number() Rule + func (r Rule) Message(text string) Rule + func (r Rule) MessageFor(key, text string) Rule + func (r Rule) Validate(ctx context.Context, field validation.Field) error