barcode.go 597 B

12345678910111213141516171819202122232425262728
  1. package barcode
  2. import "image"
  3. // Contains some meta information about a barcode
  4. type Metadata struct {
  5. // the name of the barcode kind
  6. CodeKind string
  7. // contains 1 for 1D barcodes or 2 for 2D barcodes
  8. Dimensions byte
  9. }
  10. // a rendered and encoded barcode
  11. type Barcode interface {
  12. image.Image
  13. // returns some meta information about the barcode
  14. Metadata() Metadata
  15. // the data that was encoded in this barcode
  16. Content() string
  17. }
  18. // Additional interface that some barcodes might implement to provide
  19. // the value of its checksum.
  20. type BarcodeIntCS interface {
  21. Barcode
  22. CheckSum() int
  23. }