Documentation ¶
Overview ¶
nolint:dupl
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrVersionNotFound qr version not found ErrVersionNotFound = errors.New("version not found") // ErrTooLargeSize input text is too large to encode ErrTooLargeSize = errors.New("data is too large to encode") // ErrTooSmallImageSize size of a module cannot be smaller than one pixel ErrTooSmallImageSize = errors.New("image size is too small for this qr code") )
Functions ¶
This section is empty.
Types ¶
type Code ¶
type Code struct {
// contains filtered or unexported fields
}
Code stores all metadata as well as data itself about produced QR
func (*Code) GetImage ¶
GetImage generates an image representation of the QR code using default colors (black and white)
func (*Code) GetImageWithColors ¶
type Correction ¶
type Correction int
Correction is the level of QR code correction: L, M, Q, H
const ( L Correction = iota M Q H )
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder encodes input data into a QR code
func NewEncoder ¶
func NewEncoder(options ...EncoderOptions) *Encoder
NewEncoder returns a new Encoder with default options if none are provided
type EncoderOptions ¶
type EncoderOptions func(*Encoder)
EncoderOptions is a functional object that can be provided to NewEncoder to specify parameters of Encoder
func WithCorrectionLevel ¶
func WithCorrectionLevel(level Correction) EncoderOptions
WithCorrectionLevel is an Encoder option that allows to specify a level of correction to be used in QR
func WithMaskRange ¶
func WithMaskRange(minMask, maxMask int) EncoderOptions
WithMaskRange is an Encoder option that allows to specify a range of mask can be used to optimize mask
func WithVersionRange ¶
func WithVersionRange(minVersion, maxVersion int) EncoderOptions
WithVersionRange is an Encoder option that allows to specify a range of versions can be used to encode data