barcode

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeRaw    = Mode(0)
	ModeXML    = Mode(1)
	ModeNative = Mode(2)
)

Pre defined the modes output zbarcam

Variables

View Source
var (
	ErrDataBufferEmpty = errors.New("The data buffer is empty")
	ErrFormatError     = errors.New("Unknown data format")
	ErrSkipRootTag     = errors.New("Skip root tag")
)

Errors for barcode

Functions

This section is empty.

Types

type BarCode

type BarCode struct {
	Type    string `xml:"type,attr" json:"type"`
	Quality int    `xml:"quality,attr" json:"quality"`
	Data    []byte `xml:"data" json:"data"`
}

A BarCode incoming barcode from buffer

func MustBarCode

func MustBarCode(data []byte, mode Mode) (*BarCode, error)

MustBarCode decode and create *Barcode from buffer with xml format or native format of zbarcam

func (*BarCode) ToJSON

func (b *BarCode) ToJSON() (string, error)

ToJSON returns BarCode as formatted JSON or error if serialization failed

type Mode

type Mode int

A Mode output zbarcam

Jump to

Keyboard shortcuts

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