goqr

package module
v0.0.0-...-ef3a0ce Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: CC0-1.0 Imports: 4 Imported by: 0

README

GoQR

GoQR is a simple Go package that provides an easy way to generate QR codes and save them as PNG files. It utilizes the popular github.com/skip2/go-qrcode library to generate QR codes with customizable options.

Features
  • Generate QR codes for URLs.
  • Save generated QR codes as PNG files.
  • Adjustable error correction level.
Installation

To use GoQR in your Go project, you can run:

go get -u github.com/codeArtisanry/goqr
Usage
package main

import (
	"fmt"
	"log"

	"github.com/codeArtisanry/goqr"
)

func main() {
	url := "https://vatsalchauhan.site"
	outputPath := "qrcode.png"

	result, err := goqr.GenerateAndSave(url, outputPath, true)
	if err != nil {
		log.Fatal("Error:", result, err)
	}

	fmt.Printf("QR code saved as %s\n", outputPath)
}

Refer to the example folder for more details and usage.


License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Feel free to open issues, submit pull requests, or provide suggestions to enhance the functionality of GoQR.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAndSave

func GenerateAndSave(url string, outputPath string, savePng bool) (string, error)

GenerateAndSave generates a QR code for the given URL and saves it as a PNG file.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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