Versions in this module Expand all Collapse all v0 v0.1.0 Dec 4, 2026 Changes in this version + const MaxSize + const Version + var ErrDataTooLong = errors.New("qrcode: payload exceeds QR capacity") + var ErrInvalidOption = errors.New("qrcode: invalid option") + var ErrInvalidPayload = errors.New("qrcode: invalid payload") + var ErrUnencodable = errors.New("qrcode: text cannot be encoded") + type Bitcoin struct + Address string + Amount *string + Label *string + Message *string + ReturnURL *string + func (b Bitcoin) Payload() (string, error) + type Email struct + Body *string + Subject *string + To string + func (e Email) Payload() (string, error) + type Eye uint8 + const BottomLeft + const TopLeft + const TopRight + type EyeShape uint8 + const EyeCircle + const EyeFollowsModule + const EyeSquare + type Format uint8 + const EPSFormat + const PNGFormat + const SVGFormat + func (f Format) ContentType() string + type Generator struct + func New(opts ...Option) (Generator, error) + func (g Generator) DataURI(text string, format Format) (string, error) + func (g Generator) EPS(text string) ([]byte, error) + func (g Generator) Encode(text string) (Matrix, error) + func (g Generator) Generate(text string, format Format) ([]byte, error) + func (g Generator) PNG(text string) ([]byte, error) + func (g Generator) SVG(text string) ([]byte, error) + func (g Generator) With(opts ...Option) (Generator, error) + func (g Generator) WriteTo(w io.Writer, text string, format Format) error + type Geo struct + Latitude float64 + Longitude float64 + func (g Geo) Payload() (string, error) + type GradientType uint8 + const Diagonal + const Horizontal + const InverseDiagonal + const Radial + const Vertical + type Level uint8 + const High + const Low + const Medium + const Quartile + type Matrix struct + func (m Matrix) At(x, y int) bool + func (m Matrix) Level() Level + func (m Matrix) Size() int + func (m Matrix) Version() int + type Option func(*Generator) error + func Background(c color.NRGBA) Option + func Encoding(name string) Option + func ErrorCorrection(level Level) Option + func EyeColor(eye Eye, outer, inner color.NRGBA) Option + func EyeStyle(shape EyeShape) Option + func Foreground(c color.NRGBA) Option + func Gradient(from, to color.NRGBA, kind GradientType) Option + func Logo(source image.Image, fraction float64) Option + func LogoBytes(data []byte, fraction float64) Option + func Margin(modules int) Option + func ModuleStyle(style Style, amount float64) Option + func Size(px int) Option + type PhoneNumber struct + Number string + func (p PhoneNumber) Payload() (string, error) + type SMS struct + Body *string + Number string + func (s SMS) Payload() (string, error) + type Style uint8 + const Dot + const Round + const Square + type WiFi struct + Auth WiFiAuth + Hidden *bool + Password *string + SSID string + func (w WiFi) Payload() (string, error) + type WiFiAuth string + const WiFiNoPassword + const WiFiOpen + const WiFiSAE + const WiFiWEP + const WiFiWPA