This commit is contained in:
2026-10-03 12:46:38 +07:00
parent c16c1ed5ac
commit 7a972ea960
45 changed files with 75 additions and 26 deletions
@@ -1,3 +1,4 @@
// Package team_qr_pdf generates team QR-code PDFs.
package team_qr_pdf
import (
@@ -12,8 +13,10 @@ import (
"github.com/skip2/go-qrcode"
)
// ErrNoCards indicates that no cards were provided for generation.
var ErrNoCards = errors.New("нет карточек")
// Card contains the data rendered on a team QR-code card.
type Card struct {
Name string
URL string
@@ -22,6 +25,7 @@ type Card struct {
//go:embed fonts/DejaVuSansCondensed.ttf
var font []byte
// Generate returns a PDF containing team QR-code cards.
func Generate(cards []Card) ([]byte, error) {
if len(cards) == 0 {
return nil, ErrNoCards