Documentation
¶
Index ¶
- Constants
- func Decode(reader io.Reader, imageType string) (string, error)
- func DecodeFile(imgPath string) (string, error)
- func Encode(value string, width, height int) (image.Image, error)
- func EncodeToFile(value string, width, height int, qrcodeFile string) error
- func EncodeToWriter(value string, width, height int, writer io.Writer) error
- type Name
Constants ¶
const (
VERSION = 1.0
)
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode reads a QR code from the given reader and returns its content. The imageType parameter specifies the format of the input image (e.g., "png", "jpeg"). Returns the decoded content as a string or an error if decoding fails.
func DecodeFile ¶
DecodeFile reads the QR code from the specified image file path and returns its decoded content. If the file cannot be opened or the QR code cannot be decoded, it returns an error.
func Encode ¶
Encode generates a QR code image from the given string value with specified width and height. Returns the generated image or an error if encoding fails or if the encoded content differs from the input.
func EncodeToFile ¶
EncodeToFile encodes the given value as a QR code and saves it to the specified file. The width and height parameters determine the dimensions of the generated QR code image. Returns an error if file creation or QR code generation fails.
func EncodeToWriter ¶
EncodeToWriter encodes the given string value into a QR code image with specified width and height, then writes the PNG-encoded image data to the provided io.Writer. Returns an error if encoding or writing fails.