Documentation ¶
Index ¶
- Constants
- Variables
- type Printer
- func (p *Printer) Barcode(barcode string, format int)
- func (p *Printer) Cash()
- func (p *Printer) Cut()
- func (p *Printer) End()
- func (p *Printer) Feed(params map[string]string)
- func (p *Printer) FeedAndCut(params map[string]string)
- func (p *Printer) Formfeed()
- func (p *Printer) FormfeedN(n int)
- func (p *Printer) Image(params map[string]string, data string)
- func (p *Printer) Init()
- func (p *Printer) Linefeed()
- func (p *Printer) Pulse()
- func (p *Printer) Raster(width, height, lineWidth int, imgBw []byte)
- func (p *Printer) Reset()
- func (p *Printer) SendEmphasize()
- func (p *Printer) SendFontSize()
- func (p *Printer) SendMoveX(x uint16)
- func (p *Printer) SendMoveY(y uint16)
- func (p *Printer) SendReverse()
- func (p *Printer) SendRotate()
- func (p *Printer) SendSmooth()
- func (p *Printer) SendUnderline()
- func (p *Printer) SendUpsidedown()
- func (p *Printer) SetAlign(align string)
- func (p *Printer) SetEmphasize(u byte)
- func (p *Printer) SetFont(font string)
- func (p *Printer) SetFontSize(width, height byte)
- func (p *Printer) SetLang(lang string)
- func (p *Printer) SetReverse(v byte)
- func (p *Printer) SetRotate(v byte)
- func (p *Printer) SetSmooth(v byte)
- func (p *Printer) SetUnderline(v byte)
- func (p *Printer) SetUpsidedown(v byte)
- func (p *Printer) Text(params map[string]string, text string)
- func (p *Printer) Write(buf []byte) (int, error)
- func (p *Printer) WriteNode(name string, params map[string]string, data string)
- func (p *Printer) WriteString(s string) (int, error)
- type Server
- type ServerOption
Constants ¶
const (
// DefaultEndpoint is the default server endpoint for ePOS printers.
DefaultEndpoint = "/cgi-bin/epos/service.cgi"
)
Variables ¶
var ( // ErrBodyElementEmpty is the body element empty error. ErrBodyElementEmpty = errors.New("Body element empty") )
Functions ¶
This section is empty.
Types ¶
type Printer ¶
Printer wraps sending ESC-POS commands to a io.Writer.
func NewPrinter ¶
NewPrinter creates a new printer using the specified writer.
func (*Printer) FeedAndCut ¶
FeedAndCut feeds the printer using the supplied params and then sends a cut command.
func (*Printer) Init ¶
func (p *Printer) Init()
Init resets the state of the printer, and writes the initialize code.
func (*Printer) Pulse ¶
func (p *Printer) Pulse()
Pulse sends the pulse (open drawer) code to the printer.
func (*Printer) Raster ¶
Raster writes a rasterized version of a black and white image to the printer with the specified width, height, and lineWidth bytes per line.
func (*Printer) SendEmphasize ¶
func (p *Printer) SendEmphasize()
SendEmphasize sends the emphasize / doublestrike command to the printer.
func (*Printer) SendFontSize ¶
func (p *Printer) SendFontSize()
SendFontSize sends the font size command to the printer.
func (*Printer) SendReverse ¶
func (p *Printer) SendReverse()
SendReverse sends the reverse command to the printer.
func (*Printer) SendRotate ¶
func (p *Printer) SendRotate()
SendRotate sends the rotate command to the printer.
func (*Printer) SendSmooth ¶
func (p *Printer) SendSmooth()
SendSmooth sends the smooth command to the printer.
func (*Printer) SendUnderline ¶
func (p *Printer) SendUnderline()
SendUnderline sends the underline command to the printer.
func (*Printer) SendUpsidedown ¶
func (p *Printer) SendUpsidedown()
SendUpsidedown sends the upsidedown command to the printer.
func (*Printer) SetEmphasize ¶
SetEmphasize sets the emphasize state and sends it to the printer.
func (*Printer) SetFontSize ¶
SetFontSize sets the font size state and sends the command to the printer.
func (*Printer) SetReverse ¶
SetReverse sets the reverse state and sends it to the printer.
func (*Printer) SetUnderline ¶
SetUnderline sets the underline state and sends it to the printer.
func (*Printer) SetUpsidedown ¶
SetUpsidedown sets the upsidedown state and sends it to the printer.
func (*Printer) Text ¶
Text sends a block of text to the printer using the formatting parameters in params.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server wrap
type ServerOption ¶
ServerOption is a server option.
func WithLog ¶
func WithLog(f func(string, ...interface{})) ServerOption
WithLog is a server option to set a logging func.