Documentation
¶
Index ¶
- Variables
- func IsShiny() bool
- func RenderTicket(p *escposlib.Escpos, ticket Ticket, la Layout) error
- func SplitIntoLines(text string, charsPerLine, maxLines int) []string
- type Description
- type Footer
- type Header
- type Layout
- type NoopPrinter
- type Printer
- type QR
- type ShinyHint
- type Tag
- type Ticket
- type Title
- type USBPrinter
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPrinterNotFound = errors.New("printer not found")
Functions ¶
func SplitIntoLines ¶
Types ¶
type Description ¶
type Layout ¶
type Layout struct {
QR QR `json:"qr"`
ShinyHint ShinyHint `json:"shinyHint"`
CutCommand string `json:"cutCommand"`
Header Header `json:"header"`
Tag Tag `json:"tag"`
Title Title `json:"title"`
Description Description `json:"description"`
PaperWidth int `json:"paperWidth"`
CharsPerLine int `json:"charsPerLine"`
FeedLinesBeforeCut int `json:"feedLinesBeforeCut"`
}
type NoopPrinter ¶
type NoopPrinter struct{}
func (NoopPrinter) PrintTicket ¶
func (NoopPrinter) PrintTicket(ctx context.Context, ticket Ticket) error
type USBPrinter ¶
type USBPrinter struct {
Layout Layout
EndpointNumber int
VendorID gousb.ID
ProductID gousb.ID
// contains filtered or unexported fields
}
func NewUSBPrinter ¶
func NewUSBPrinter(vendorID, productID uint16, endpointNumber int, layout Layout) *USBPrinter
func (*USBPrinter) PrintTicket ¶
func (p *USBPrinter) PrintTicket(ctx context.Context, ticket Ticket) error
Click to show internal directories.
Click to hide internal directories.