Documentation
¶
Overview ¶
Package ipp is the slice of the Internet Printing Protocol (RFC 8010 and 8011) the print dialog needs from CUPS: list the printers (CUPS-Get-Printers) and send a job (Print-Job), over the CUPS domain socket or CUPS_SERVER. Pure Go; no libcups.
Index ¶
Constants ¶
const ( StateIdle int32 = 3 StateProcessing int32 = 4 StateStopped int32 = 5 )
The printer-state values.
const ( OpPrintJob uint16 = 0x0002 OpCUPSGetPrinters uint16 = 0x4002 )
Operations.
const ( TagInteger byte = 0x21 TagBoolean byte = 0x22 TagEnum byte = 0x23 TagRange byte = 0x33 TagText byte = 0x41 TagName byte = 0x42 TagKeyword byte = 0x44 TagURI byte = 0x45 TagCharset byte = 0x47 TagLanguage byte = 0x48 TagMimeMedia byte = 0x49 )
Value tags.
Variables ¶
This section is empty.
Functions ¶
func DefaultServer ¶
func DefaultServer() string
DefaultServer is libcups' server choice: $CUPS_SERVER (a socket path or host[:port]), else the scheduler's domain socket, else localhost:631.
func IsNotFound ¶
IsNotFound reports client-error-not-found (no such printer, or no printers at all for CUPS-Get-Printers).
func PrinterURI ¶
PrinterURI is the queue's URI as CUPS names it.
Types ¶
type Attr ¶
Attr is one named attribute with its values.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks IPP to one CUPS server.
type Group ¶
Group is one attribute group.
type Job ¶
type Job struct {
Printer, Title, User string
// Format is the document's MIME type.
Format string
// Attrs are the job template attributes (copies, sides, media...).
Attrs []Attr
Document io.Reader
}
Job is one document to spool.
type Message ¶
Message is a request (Code is the operation) or a response (Code is the status).
type Printer ¶
type Printer struct {
Name, Location, StateMessage string
// State is printer-state: 3 idle, 4 processing, 5 stopped.
State int32
Accepting bool
// Media are its PWG media names, Sides its sides keywords,
// ColorModes its print-color-mode keywords, Qualities its
// print-quality enums; each with its default.
Media, Sides, ColorModes []string
MediaDefault, SidesDefault string
ColorModeDefault string
Qualities []int32
QualityDefault int32
}
Printer is one queue as the dialog lists it, with what it supports (empty when it does not say).
type StatusError ¶
StatusError is an unsuccessful IPP status.
func (*StatusError) Error ¶
func (e *StatusError) Error() string