barcode

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package barcode scans QR codes and barcodes with the camera, on a screen of its own.

nimbus native plugin add barcode

code, err := barcode.Scan(ctx)
if plugin.IsCode(err, plugin.Cancelled) { return }

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

type Code struct {
	Value  string `json:"value"`  // what it says
	Format string `json:"format"` // "qr", "ean13", "code128", ...
}

Code is what was scanned.

func Scan

func Scan(ctx context.Context) (Code, error)

Scan opens the scanner and returns the first code it reads. It fails with plugin.Cancelled if they back out, and plugin.Unavailable where there's no camera, as on the iOS simulator. Android uses Google Play services' scanner.

Jump to

Keyboard shortcuts

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