qrcodeTerminal

package module
v0.0.0-...-c0650d8 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2017 License: BSD-3-Clause Imports: 5 Imported by: 287 modules, 301 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

qrcode-terminal-go

QRCode terminal for golang.

Example

package main

import "github.com/Baozisoftware/qrcode-terminal-go"

func main() {
	Test1()
	Test2()
}

func Test1(){
	content := "Hello, 世界"
	obj := qrcodeTerminal.New()
	obj.Get(content).Print()
}

func Test2(){
	content := "https://github.com/Baozisoftware/qrcode-terminal-go"
	obj := qrcodeTerminal.New2(qrcodeTerminal.ConsoleColors.BrightBlue,qrcodeTerminal.ConsoleColors.BrightGreen,qrcodeTerminal.QRCodeRecoveryLevels.Low)
	obj.Get([]byte(content)).Print()
}

Screenshots

Windows XP

winxp

Windows 7

win7

Windows 10

win10

Ubuntu

ubuntu

macOS

macos

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConsoleColors consoleColors = consoleColors{
		NormalBlack:   "\033[38;5;0m  \033[0m",
		NormalRed:     "\033[38;5;1m  \033[0m",
		NormalGreen:   "\033[38;5;2m  \033[0m",
		NormalYellow:  "\033[38;5;3m  \033[0m",
		NormalBlue:    "\033[38;5;4m  \033[0m",
		NormalMagenta: "\033[38;5;5m  \033[0m",
		NormalCyan:    "\033[38;5;6m  \033[0m",
		NormalWhite:   "\033[38;5;7m  \033[0m",
		BrightBlack:   "\033[48;5;0m  \033[0m",
		BrightRed:     "\033[48;5;1m  \033[0m",
		BrightGreen:   "\033[48;5;2m  \033[0m",
		BrightYellow:  "\033[48;5;3m  \033[0m",
		BrightBlue:    "\033[48;5;4m  \033[0m",
		BrightMagenta: "\033[48;5;5m  \033[0m",
		BrightCyan:    "\033[48;5;6m  \033[0m",
		BrightWhite:   "\033[48;5;7m  \033[0m"}
	QRCodeRecoveryLevels = qrcodeRecoveryLevels{
		Low:     qrcodeRecoveryLevel(qrcode.Low),
		Medium:  qrcodeRecoveryLevel(qrcode.Medium),
		High:    qrcodeRecoveryLevel(qrcode.High),
		Highest: qrcodeRecoveryLevel(qrcode.Highest)}
)

Functions

func New

func New() *qrcodeTerminal

func New2

func New2(front, back consoleColor, level qrcodeRecoveryLevel) *qrcodeTerminal

Types

type QRCodeString

type QRCodeString string

func (*QRCodeString) Print

func (v *QRCodeString) Print()

Jump to

Keyboard shortcuts

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