Versions in this module Expand all Collapse all v0 v0.2.0 Sep 6, 2026 Changes in this version + func ClearCustomTemplates() + func GenerateFromTemplate(text, templateID string, override ...TemplateOverride) ([]byte, error) + func RegisterTemplate(t Template) error + func SaveFromTemplate(text, path, templateID string, override ...TemplateOverride) error + func UnregisterTemplate(id string) + type Template struct + Category TemplateCategory + ID string + Level ErrorCorrectionLevel + Name string + Options FancyOptions + func BuiltinTemplates() []Template + func GetTemplate(id string) (Template, bool) + func ListTemplates(category TemplateCategory) []Template + type TemplateCategory string + const CategoryClassic + const CategoryCreative + const CategoryCustom + const CategorySimple + type TemplateOverride struct + BgColor color.Color + BgTransparent bool + BorderWidth int + FgColor color.Color + FgGradient *LinearGradient + Halftone image.Image + Logo image.Image + LogoSafeZone bool + LogoSizeMultiplier int + ModuleWidth uint8 v0.1.0 Aug 17, 2026 Changes in this version + const TokenPrefix + func Decode(img image.Image) (string, error) + func DecodeBytes(data []byte) (string, error) + func DecodeFile(path string) (string, error) + func Decrypt(token string, key []byte) (string, error) + func Encrypt(payload string, key []byte) (string, error) + func Generate(text string, level ErrorCorrectionLevel, size int) (image.Image, error) + func GenerateFancy(text string, level ErrorCorrectionLevel, opts FancyOptions) ([]byte, error) + func GenerateFancyImage(text string, level ErrorCorrectionLevel, opts FancyOptions) (image.Image, error) + func GeneratePNG(text string, level ErrorCorrectionLevel, size int) ([]byte, error) + func GenerateSecure(payload string, encryptKey, signKey []byte, level ErrorCorrectionLevel, ...) (image.Image, error) + func GenerateSigned(payload string, secret []byte, level ErrorCorrectionLevel, size int) (image.Image, error) + func GenerateWithLogo(text string, level ErrorCorrectionLevel, size int, logo image.Image, ...) (image.Image, error) + func GenerateWithLogoFile(text string, level ErrorCorrectionLevel, size int, logoPath string, ...) (image.Image, error) + func GenerateWithLogoPNG(text string, level ErrorCorrectionLevel, size int, logo image.Image, ...) ([]byte, error) + func IsSecureToken(s string) bool + func Save(text, path string, level ErrorCorrectionLevel, size int) error + func SaveFancy(text, path string, level ErrorCorrectionLevel, opts FancyOptions) error + func SaveWithLogo(text, path string, level ErrorCorrectionLevel, size int, logo image.Image, ...) error + func SaveWithLogoFile(text, outputPath string, level ErrorCorrectionLevel, size int, logoPath string, ...) error + func Secure(payload string, encryptKey, signKey []byte) (string, error) + func Sign(payload string, secret []byte) (string, error) + func Unseal(token string, encryptKey, signKey []byte, maxAge time.Duration) (string, error) + func Verify(token string, secret []byte, maxAge time.Duration) (string, error) + type ColorStop struct + Color color.Color + T float64 + type ErrorCorrectionLevel int + const ECLHigh + const ECLLow + const ECLMedium + const ECLQuartile + type FancyOptions struct + BgColor color.Color + BgTransparent bool + BorderWidth int + FgColor color.Color + FgGradient *LinearGradient + Finder FinderShape + Halftone image.Image + Logo image.Image + LogoSafeZone bool + LogoSizeMultiplier int + Module ModuleShape + ModuleWidth uint8 + func FancyCirclePreset(fg, bg color.Color) FancyOptions + func FancyGradientPreset(gradient *LinearGradient) FancyOptions + func FancyHalftonePreset(src image.Image, fg color.Color) FancyOptions + func FancyLogoPreset(logo image.Image) FancyOptions + type FinderShape int + const FinderRounded + const FinderSquare + type LinearGradient struct + Angle float64 + Stops []ColorStop + func NewLinearGradient(angle float64, stops ...ColorStop) *LinearGradient + type ModuleShape int + const ShapeCircle + const ShapeDiamond + const ShapeHStripe + const ShapeLiquid + const ShapeRectangle + const ShapeRounded + const ShapeVStripe