Versions in this module Expand all Collapse all v0 v0.1.0 Sep 22, 2026 Changes in this version + var ANMAT = Regulator + var ANVISA = Regulator + var COFEPRIS = Regulator + var ErrEmptyInput = errors.New("gs1: empty input") + var ErrInvalidCheckDigit = errors.New("gs1: invalid check digit") + var ErrInvalidData = errors.New("gs1: invalid data") + var ErrInvalidDate = errors.New("gs1: invalid date") + var ErrMissingRequiredAI = errors.New("gs1: missing required AI") + var ErrTruncatedData = errors.New("gs1: truncated data") + var ErrUnknownAI = errors.New("gs1: unknown application identifier") + var SNFA = Regulator + func ComputeGTINCheckDigit(partial string) (byte, error) + func ExpandUPCE(upce string) (string, error) + func ParseDate(yymmdd string) (time.Time, error) + func ParseDateRaw(yymmdd string) (string, error) + func ParseDateWithOptions(yymmdd string, opts DateOptions) (time.Time, error) + func ParseInto(input string, b *Barcode) error + func ValidateGTIN(gtin string) error + type AI struct + Code string + Format string + Name string + func LookupAI(code string) (AI, bool) + type Barcode struct + Elements []Element + Raw string + func Parse(input string) (Barcode, error) + func (b *Barcode) Reset() + func (b Barcode) BestBeforeDate() (time.Time, error) + func (b Barcode) Count() string + func (b Barcode) ExpirationDate() (time.Time, error) + func (b Barcode) GTIN() string + func (b Barcode) Get(ai string) (string, bool) + func (b Barcode) Lot() string + func (b Barcode) ProductionDate() (time.Time, error) + func (b Barcode) SSCC() string + func (b Barcode) SerialNumber() string + func (b Barcode) ValidateANMAT() error + func (b Barcode) ValidateANVISA() error + func (b Barcode) ValidateCOFEPRIS() error + func (b Barcode) ValidateSNFA() error + type DateFormat int + const DateFormatRaw + const DateFormatTime + type DateOptions struct + DayZero DayZeroPolicy + Format DateFormat + type DayZeroPolicy int + const DayZeroFirstDay + const DayZeroLastDay + type Element struct + AI string + Value string + type Regulator struct + Country string + Name string + RequiredAIs []string + func (r Regulator) Validate(b Barcode) error