Versions in this module Expand all Collapse all v1 v1.0.0 Apr 19, 2026 Changes in this version + func ContextWithQR(ctx context.Context, gen Generator) context.Context + func GenerateASCII(ctx context.Context, gen Generator, p payload.Payload) (string, error) + func GenerateBase64(ctx context.Context, gen Generator, p payload.Payload) (string, error) + func GeneratePNG(ctx context.Context, gen Generator, p payload.Payload) ([]byte, error) + func GenerateSVG(ctx context.Context, gen Generator, p payload.Payload) (string, error) + func Quick(data string, size ...int) ([]byte, error) + func QuickContact(firstName, lastName, phone, email string, size ...int) ([]byte, error) + func QuickEmail(to, subject, body string, size ...int) ([]byte, error) + func QuickEvent(title, location string, start, end time.Time, size ...int) ([]byte, error) + func QuickFile(data, path string, size ...int) error + func QuickGeo(lat, lng float64, size ...int) ([]byte, error) + func QuickPayment(username, amount string, size ...int) ([]byte, error) + func QuickSMS(phone, message string, size ...int) ([]byte, error) + func QuickSVG(data string, size ...int) (string, error) + func QuickURL(url string, size ...int) ([]byte, error) + func QuickWiFi(ssid, password, encryption string, size ...int) ([]byte, error) + func Save(ctx context.Context, gen Generator, p payload.Payload, path string) error + func SavePNG(ctx context.Context, gen Generator, p payload.Payload, path string) error + func SaveSVG(ctx context.Context, gen Generator, p payload.Payload, path string) error + type Builder struct + func NewBuilder() *Builder + func (b *Builder) AutoSize(auto bool) *Builder + func (b *Builder) BackgroundColor(color string) *Builder + func (b *Builder) Build() (Generator, error) + func (b *Builder) BuildAndGeneratePNG(ctx context.Context, p payload.Payload) ([]byte, error) + func (b *Builder) BuildAndGenerateSVG(ctx context.Context, p payload.Payload) (string, error) + func (b *Builder) BuildAndSave(ctx context.Context, p payload.Payload, path string) error + func (b *Builder) Clone() *Builder + func (b *Builder) ErrorCorrection(level ErrorCorrectionLevel) *Builder + func (b *Builder) ForegroundColor(color string) *Builder + func (b *Builder) Format(f Format) *Builder + func (b *Builder) Logo(source string, sizeRatio float64) *Builder + func (b *Builder) LogoOverlay(enabled bool) *Builder + func (b *Builder) LogoTint(color string) *Builder + func (b *Builder) Margin(margin int) *Builder + func (b *Builder) MaskPattern(pattern int) *Builder + func (b *Builder) MaxVersion(v int) *Builder + func (b *Builder) MinVersion(v int) *Builder + func (b *Builder) MustBuild() Generator + func (b *Builder) Options(opts ...Option) *Builder + func (b *Builder) Prefix(prefix string) *Builder + func (b *Builder) QueueSize(n int) *Builder + func (b *Builder) Quick(data string, size ...int) ([]byte, error) + func (b *Builder) QuickContact(firstName, lastName, phone, email string, size ...int) ([]byte, error) + func (b *Builder) QuickEmail(to, subject, body string, size ...int) ([]byte, error) + func (b *Builder) QuickEvent(title, location string, start, end time.Time, size ...int) ([]byte, error) + func (b *Builder) QuickFile(data, path string, size ...int) error + func (b *Builder) QuickGeo(lat, lng float64, size ...int) ([]byte, error) + func (b *Builder) QuickSMS(phone, message string, size ...int) ([]byte, error) + func (b *Builder) QuickSVG(data string, size ...int) (string, error) + func (b *Builder) QuickURL(url string, size ...int) ([]byte, error) + func (b *Builder) QuickWiFi(ssid, password, encryption string, size ...int) ([]byte, error) + func (b *Builder) Size(size int) *Builder + func (b *Builder) Version(v int) *Builder + func (b *Builder) WorkerCount(n int) *Builder + type Config struct + AutoSize bool + BackgroundColor string + DefaultECLevel string + DefaultFormat string + DefaultSize int + DefaultVersion int + ForegroundColor string + LogoOverlay bool + LogoSizeRatio float64 + LogoSource string + LogoTint string + MaskPattern int + MaxVersion int + MinVersion int + Prefix string + QueueSize int + QuietZone int + SlowOperation time.Duration + WorkerCount int + func (c *Config) Clone() *Config + func (c *Config) Merge(other *Config) + func (c *Config) Validate() error + type ErrorCorrectionLevel int + const LevelH + const LevelL + const LevelM + const LevelQ + func (l ErrorCorrectionLevel) String() string + type Format int + const FormatBase64 + const FormatPDF + const FormatPNG + const FormatSVG + const FormatTerminal + func (f Format) String() string + type Generator interface + Batch func(ctx context.Context, payloads []payload.Payload, opts ...Option) ([]*encoding.QRCode, error) + Close func(ctx context.Context) error + Closed func() bool + Generate func(ctx context.Context, p payload.Payload) (*encoding.QRCode, error) + GenerateToWriter func(ctx context.Context, p payload.Payload, w io.Writer, format Format) error + GenerateWithOptions func(ctx context.Context, p payload.Payload, opts ...Option) (*encoding.QRCode, error) + SetOptions func(opts ...Option) error + func MustNew(opts ...Option) Generator + func New(opts ...Option) (Generator, error) + func QRFromContext(ctx context.Context) (Generator, bool) + type Option func(*Config) + func WithAutoSize(auto bool) Option + func WithBackgroundColor(color string) Option + func WithConcurrency(n int) Option + func WithDefaultFormat(f Format) Option + func WithDefaultSize(size int) Option + func WithErrorCorrection(level ErrorCorrectionLevel) Option + func WithForegroundColor(color string) Option + func WithLogo(logoSource string, sizeRatio float64) Option + func WithLogoOverlay(enabled bool) Option + func WithLogoTint(color string) Option + func WithMaskPattern(pattern int) Option + func WithMaxVersion(v int) Option + func WithMinVersion(v int) Option + func WithPrefix(prefix string) Option + func WithQueueSize(n int) Option + func WithQuietZone(zone int) Option + func WithSlowOperation(d time.Duration) Option + func WithVersion(v int) Option + func WithWorkerCount(n int) Option Other modules containing this package github.com/os-gomod/qrcode/v2