qrscanner

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package qrscanner は画面キャプチャからQRコードを読み取る機能を提供する

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoQRCodeFound はQRコードが見つからない場合のエラー
	ErrNoQRCodeFound = errors.New("no QR code found in the captured image")

	// ErrNoTOTPQRFound はTOTP用のQRコードが見つからない場合のエラー
	ErrNoTOTPQRFound = errors.New("no TOTP QR code found (otpauth://totp/...)")

	// ErrScreenCaptureFailed は画面キャプチャに失敗した場合のエラー
	ErrScreenCaptureFailed = errors.New("failed to capture screen")
)

Functions

func GenerateQRCodeImage added in v0.1.0

func GenerateQRCodeImage(uri string) (image.Image, error)

GenerateQRCodeImage はURIからQRコード画像を生成する

Types

type ScanResult

type ScanResult struct {
	Entry *totpstore.Entry // パース済みのTOTPエントリ
	URI   string           // 元のotpauth:// URI
}

ScanResult はQRスキャン結果を表す構造体

func CaptureAndScan

func CaptureAndScan() ([]ScanResult, error)

CaptureAndScan は画面全体をキャプチャしてQRコードをスキャンする

func ScanImage

func ScanImage(img image.Image) ([]ScanResult, error)

ScanImage は指定した画像からQRコードをスキャンする(テスト用)

Jump to

Keyboard shortcuts

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