Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithBlocksize ¶
func WithBlocksize(blocksize int) func(*opts)
func WithBorderwidth ¶
func WithBorderwidth(borderwidth int) func(*opts)
func WithRecoveryLevel ¶
func WithRecoveryLevel(level RecoveryLevel) func(*opts)
Types ¶
type Block ¶
type Block struct {
X int `xml:"x,attr"`
Y int `xml:"y,attr"`
Width int `xml:"width,attr"`
Height int `xml:"height,attr"`
Fill string `xml:"fill,attr"`
Class string `xml:"class,attr,omitempty"`
}
Block is a color block in the rendered QR code.
type CDataString ¶
type CDataString struct {
Value string `xml:",cdata"`
}
type QR ¶
type QR struct {
Code *qrcode.QRCode // underlying QR Code
Blocksize int // size of each block in pixels, default = 16 pixels
Borderwidth int // size of the border in blocks, default = 4 blocks
Borderfill color.Color // fill color for the border
Style *CDataString // css styling
}
QR holds a QR Code (from github.com/skip2/go-qrcode) and SVG settings.
func New ¶
New returns the QR for the provided string, with default settings for blocksize, borderwidth and background color. Call .String() to obtain the SVG string.
type RecoveryLevel ¶
type RecoveryLevel = qrcode.RecoveryLevel
const ( Low RecoveryLevel = qrcode.Low Medium RecoveryLevel = qrcode.Medium High RecoveryLevel = qrcode.High Highest RecoveryLevel = qrcode.Highest )