Versions in this module Expand all Collapse all v2 v2.0.0 Apr 26, 2024 Changes in this version + const CharsetAlphabetic + const CharsetAlphanumeric + const CharsetNumbers + var ErrInvalidCharset = errors.New("invalid charset, charset length should be greater than 0") + var ErrInvalidCount = errors.New("invalid count, It should be greater than 0") + var ErrInvalidPattern = errors.New("invalid pattern, pattern cannot be empty") + var ErrNotFeasible = errors.New("Not feasible to generate requested number of codes") + var ErrPatternIsNotMatch = errors.New("Pattern is not match with the length value") + type Generator struct + Charset string + Count uint16 + Length uint16 + Pattern string + Prefix string + Suffix string + func Default() *Generator + func NewWithOptions(opts ...Option) (*Generator, error) + func (g *Generator) Run() ([]string, error) + type Option func(*Generator) error + func SetCharset(charset string) Option + func SetCount(count uint16) Option + func SetLength(length uint16) Option + func SetPattern(pattern string) Option + func SetPrefix(prefix string) Option + func SetSuffix(suffix string) Option Other modules containing this package github.com/AmirSoleimani/VoucherCodeGenerator