qr

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package qr provides utilities for generate, render and working with QR-Codes

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrQRFileNotFound = errors.New("QR-Code file not found")
	ErrQRNotGenerated = errors.New("QR-Code not generated")
)

Functions

This section is empty.

Types

type QRCode

type QRCode struct {
	QR *qrcode.QRCode

	From string
	// contains filtered or unexported fields
}

QRCode represents a QR-Code.

func New

func New(s string) *QRCode

New creates a new QR-Code.

func (*QRCode) GenImg

func (q *QRCode) GenImg(s string) error

GenImg generates the PNG from the QR-Code.

func (*QRCode) Generate

func (q *QRCode) Generate() error

Generate generates a QR-Code from a given string.

func (*QRCode) Label

func (q *QRCode) Label(s, pos string) error

Label adds a label to an image, with the given position (top or bottom).

func (*QRCode) Open

func (q *QRCode) Open() error

Open opens a QR-Code image in the system default image viewer.

func (*QRCode) Render

func (q *QRCode) Render()

Render renders a QR-Code to the standard output.

func (*QRCode) String

func (q *QRCode) String() string

type RenderOpts

type RenderOpts struct {
	// contains filtered or unexported fields
}

RenderOpts contains options for rendering, including image, font, and position calculation function.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL