qrcode

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExtJPG = ".jpg"
	ExtPNG = ".png"
	ExtGIF = ".gif"
	ExtBMP = ".bmp"
)

扩展名,支持四种图片二维码生成

Variables

This section is empty.

Functions

This section is empty.

Types

type MetaInfo

type MetaInfo struct {
	Content string // 内容
	Level   qr.ErrorCorrectionLevel
	Mode    qr.Encoding
	Width   int
	Height  int
	Ext     string // 命名扩展名
}

MetaInfo 元信息

func (*MetaInfo) Encode added in v1.0.3

func (sf *MetaInfo) Encode() (barcode.Barcode, error)

Encode encode to barcode.Barcode

func (*MetaInfo) Filename added in v1.0.3

func (sf *MetaInfo) Filename() string

Filename filename

func (*MetaInfo) ToBase64 added in v1.0.3

func (sf *MetaInfo) ToBase64() (string, error)

ToBase64 generate QR code to base64 string, return base64 string

func (*MetaInfo) ToBytes added in v1.0.3

func (sf *MetaInfo) ToBytes() ([]byte, error)

ToBytes generate to byte

func (*MetaInfo) ToImageB64 added in v1.0.3

func (sf *MetaInfo) ToImageB64() (string, error)

ToImageB64 generate QR code to base images string, return base64 image string base64 images string format like: data: image/png;base64,xxxxxxxxxx

func (*MetaInfo) Write added in v1.0.3

func (sf *MetaInfo) Write(w io.Writer) error

Write wirte QR code

func (*MetaInfo) WriteFile added in v1.0.3

func (sf *MetaInfo) WriteFile(path string) (string, error)

WriteFile write QR code to file, return filename

Jump to

Keyboard shortcuts

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