qrcode

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingSellerName      = errors.New("missing `SellerName`")
	ErrMissingSellerTaxNumber = errors.New("missing `SellerTaxNumber`")
	ErrMissingTimestamp       = errors.New("missing `Timestamp`")
	ErrMissingInvoiceTotal    = errors.New("missing `InvoiceTotal`")
	ErrMissingTotalVAT        = errors.New("missing `TotalVAT`")

	ErrSellerNameTooLong      = errors.New("`SellerName` is too long")
	ErrSellerTaxNumberTooLong = errors.New("`SellerTaxNumber` is too long")
)

Functions

func EncodeTLV

func EncodeTLV(d Data) (string, error)

EncodeTLV return base64 hash value for given Data. Internally this function will call `Data.Validate()` for validating the input data.

Types

type Data

type Data struct {
	SellerName      string
	SellerTaxNumber string
	Timestamp       time.Time
	InvoiceTotal    float64
	TotalVAT        float64
}

Data represents decoded data inside QRCode

func DecodeTLV

func DecodeTLV(hash string) (*Data, error)

DecodeTLV returns Data for given base64 hash string.

func (Data) String

func (d Data) String() string

String returns string representation of Data

func (Data) Validate

func (i Data) Validate() error

Validate is used for validating Data

Jump to

Keyboard shortcuts

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