Versions in this module Expand all Collapse all v0 v0.4.0 Aug 17, 2026 v0.3.0 Jul 11, 2026 Changes in this version type Job + func (j *Job) Snapshot() JobSnapshot + type JobSnapshot struct + Completed time.Time + Created time.Time + Format string + ID JobID + JobURI string + Name string + PrinterName string + PrinterURI string + Processing time.Time + State JobState + StateReasons []JobStateReason + Username string + type PrinterSnapshot struct + Info string + MakeAndModel string + MediaDefault string + Name string + Ready bool + State PrinterState + UUID string + UpTime int type PrinterState + func (i PrinterState) String() string type Server + func (s *Server) Snapshot() ServerSnapshot + type ServerSnapshot struct + BaseURL string + BonjourEnabled bool + Debug bool + DumpDir string + Jobs []JobSnapshot + ListenAddr string + MaxDocumentSize int64 + Printers []PrinterSnapshot + Uptime time.Duration v0.2.0 Jul 9, 2026 v0.1.2 Jul 6, 2026 Changes in this version + var ErrPrintOptionsUnsupported = errors.New("printer does not support print job options") + type OptionPrinter interface + PrintWithOptions func(ctx context.Context, data []byte, opts PrintOptions) error + type PrintOptions struct + TrimTrailingBlank bool v0.1.1 Jul 5, 2026 Changes in this version type Job + Format string v0.1.0 Jul 4, 2026 Changes in this version type Option + func WithBonjour() Option v0.0.5 Aug 3, 2025 v0.0.4 Jul 25, 2025 Changes in this version + var ErrEmptyData = errors.New("data cannot be empty") + var ErrNoDriver = errors.New("no driver set for printer") + var ErrNoImages = errors.New("no images were converted from the data") + var MaxDocumentSize int64 = 104857600 + type Driver interface + DPI func() float64 + PrintImage func(ctx context.Context, img image.Image) error + SetOptions func(opt ...thermoprint.Option) error + Width func() int + type Filter interface + ToRaster func(ctx context.Context, dpi int, data []byte) ([]image.Image, error) + Type func() string + type IPPHandler interface + ServeIPP func(ctx context.Context, req *goipp.Message, body []byte) (resp *goipp.Message, err error) + type IPPHandlerFunc func(ctx context.Context, req *goipp.Message, body []byte) (resp *goipp.Message, err error) + func (f IPPHandlerFunc) ServeIPP(ctx context.Context, req *goipp.Message, body []byte) (resp *goipp.Message, err error) + type IPPRequest struct + type Job struct + Completed time.Time + Created time.Time + ID JobID + JobURI string + Name string + Printer Printer + PrinterURI string + Processing time.Time + State JobState + StateReasons []JobStateReason + Username string + func (j *Job) IsActive() bool + func (j *Job) IsCompleted() bool + type JobID int32 + type JobState int32 + const JobAborted + const JobCancelled + const JobCompleted + const JobPending + const JobPendingHeld + const JobProcessing + const JobProcessingStopped + func (i JobState) String() string + type JobStateReason string + const JSRAbortedBySystem + const JSRDocumentAccessError + const JSRDocumentFormatError + const JSRJobCancelledAtDevice + const JSRJobCancelledByOperator + const JSRJobCancelledByUser + const JSRJobCompletedSuccessfully + const JSRJobCompletedWithErrors + const JSRJobCompletedWithWarnings + const JSRJobDataInsufficient + const JSRJobHeldUntilSpecified + const JSRJobIncoming + const JSRJobOutgoing + const JSRJobPrinting + const JSRJobQueued + const JSRJobRestartable + const JSRJobTransforming + const JSRNone + const JSROther + const JSRProcessingToStopPoint + const JSRQueuedInDevice + const JSRResourcesAreNotReady + const JSRServiceOffline + const JSRSubmissionInterrupted + const JSRUnsupportedCompression + const JSRUnsupportedDocumentFormat + type Option func(*Server) + func WithAdditionalPrinters(pp ...Printer) Option + func WithDebug(b bool) Option + func WithDumpDir(dir string) Option + type Printer interface + Driver func() Driver + Print func(ctx context.Context, data []byte) error + func WrapDriver(drv Driver, id, fullname string, opt ...PrinterOption) (Printer, error) + type PrinterInformer interface + Info func() string + MakeAndModel func() string + MediaDefault func() string + MediaSupported func() []string + Name func() string + Ready func() bool + SetState func(state PrinterState) + State func() PrinterState + UUID func() string + UpTime func() int + type PrinterOption func(*basePrinter) error + func WithFilter(f Filter) PrinterOption + type PrinterState uint16 + const PSIdle + const PSProcessing + const PSStopped + type Server struct + func New(p Printer, opts ...Option) (*Server, error) + func (s *Server) DebugServer(ctx context.Context, addr string) error + func (s *Server) Info(w io.Writer) + func (s *Server) ListenAndServe(addr string) error + func (s *Server) Shutdown(ctx context.Context) error