base1dcode.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Package utils contain some utilities which are needed to create barcodes
  2. package utils
  3. import (
  4. "image"
  5. "image/color"
  6. "github.com/boombuler/barcode"
  7. )
  8. type base1DCode struct {
  9. *BitList
  10. kind string
  11. content string
  12. }
  13. type base1DCodeIntCS struct {
  14. base1DCode
  15. checksum int
  16. }
  17. func (c *base1DCode) Content() string {
  18. return c.content
  19. }
  20. func (c *base1DCode) Metadata() barcode.Metadata {
  21. return barcode.Metadata{c.kind, 1}
  22. }
  23. func (c *base1DCode) ColorModel() color.Model {
  24. return color.Gray16Model
  25. }
  26. func (c *base1DCode) Bounds() image.Rectangle {
  27. return image.Rect(0, 0, c.Len(), 1)
  28. }
  29. func (c *base1DCode) At(x, y int) color.Color {
  30. if c.GetBit(x) {
  31. return color.Black
  32. }
  33. return color.White
  34. }
  35. func (c *base1DCodeIntCS) CheckSum() int {
  36. return c.checksum
  37. }
  38. // New1DCode creates a new 1D barcode where the bars are represented by the bits in the bars BitList
  39. func New1DCodeIntCheckSum(codeKind, content string, bars *BitList, checksum int) barcode.BarcodeIntCS {
  40. return &base1DCodeIntCS{base1DCode{bars, codeKind, content}, checksum}
  41. }
  42. // New1DCode creates a new 1D barcode where the bars are represented by the bits in the bars BitList
  43. func New1DCode(codeKind, content string, bars *BitList) barcode.Barcode {
  44. return &base1DCode{bars, codeKind, content}
  45. }
PANIC: session(release): write data/sessions/d/6/d6183eeb014b697e: no space left on device

PANIC

session(release): write data/sessions/d/6/d6183eeb014b697e: no space left on device
github.com/go-macaron/session@v0.0.0-20190805070824-1a3cdc6f5659/session.go:199 (0x8b2934)
gopkg.in/macaron.v1@v1.3.9/context.go:79 (0x83d0a0)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8)
gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8)
gopkg.in/macaron.v1@v1.3.9/context.go:112 (0x84fdb5)
gopkg.in/macaron.v1@v1.3.9/recovery.go:161 (0x84fda8)
gopkg.in/macaron.v1@v1.3.9/logger.go:40 (0x840c73)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8)
gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8)
gopkg.in/macaron.v1@v1.3.9/router.go:187 (0x850fc6)
gopkg.in/macaron.v1@v1.3.9/router.go:303 (0x8493e5)
gopkg.in/macaron.v1@v1.3.9/macaron.go:220 (0x841fca)
net/http/server.go:2836 (0x7a79b2)
net/http/server.go:1924 (0x7a341b)
runtime/asm_amd64.s:1373 (0x46f9f0)