qrcode2console

package module
Version: v0.0.0-...-3e81826 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

README

qrcode2console

链接生成二维码输出到console或者是二维码图片输出到console

安装

go get -u github.com/Han-Ya-Jun/qrcode2console

示例

func TestNewQRCode2ConsoleWithUrl(t *testing.T) {
	qr := NewQRCode2ConsoleWithUrl("https://hanyajun.com", true)
	//qr.Debug()
	qr.Output()
}

func TestNewQRCode2ConsoleWithPath(t *testing.T) {
	qr := NewQRCode2ConsoleWithPath("qrcode.jpg")
	//qr.Debug()
	qr.Output()
}

效果

image image

Documentation

Index

Constants

View Source
const (
	QR_CODE_SIZE        = 256
	SHRINK_QR_CODE_SIZE = 35
	MARGIN              = 29
	MULTIPLE            = 6
)

* @Author:hanyajun * @Date:2019/4/30 14:56 * @Name:qrcode2console * @Function: 二维码输出到console

Variables

This section is empty.

Functions

This section is empty.

Types

type QRCode2Console

type QRCode2Console struct {
	Path string
	// contains filtered or unexported fields
}

func NewQRCode2ConsoleWithPath

func NewQRCode2ConsoleWithPath(path string) *QRCode2Console

通过二维码图片

func NewQRCode2ConsoleWithUrl

func NewQRCode2ConsoleWithUrl(url string, genImg bool) *QRCode2Console

NewQRCode 返回二维码结构

func (*QRCode2Console) Output

func (qr *QRCode2Console) Output()

Output 控制台输出二维码

func (*QRCode2Console) SetImage

func (qr *QRCode2Console) SetImage(img image.Image) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL