ipp

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package ipp is the IPP input and output of docflow: the printers a job is printed on (the kind printer, over IPP, port 9100 or LPD), the CUPS servers jobs are printed to (the kind cups, an entry: a source), and the queues of CUPS servers jobs are printed on (the kind cups-out, an exit: a sink), as docflow's kinds of node are registered. A program that imports it serves them.

A CUPS server node is the one way IPP enters the topology (the other entries, an uploader or an S3 trigger, take files over HTTP, at the API). Its own port is a CUPS server with one printer, the node, at /printers/<node>; the node is also an IPP printer at /ipp/print/<name> of the manager's own server (an ingress: on a serverless deployment, with no ports, the only one). A sender (a WMS, a business system, an office PC) prints to it as to any printer, and the job follows the node's edges from there. The manager's own server takes the operations of one request alone (Print-Job, not Create-Job and Send-Document), so that a request is all there is to a job: no instance waits for a document. A node's own port, where one process listens, takes Create-Job and Send-Document too (created.go), as IPP Everywhere asks: there it is an AirPrint, IPP Everywhere and Mopria printer that Macs, iPhones, Android and Windows add without a driver. /ipp/print itself answers CUPS-Get-Printers with the CUPS server nodes, as a CUPS server lists its destinations.

Index

Constants

View Source
const (
	// KindPrinter prints the job on paper: a printer the manager reaches
	// over the network (Node.URL), the way its jobs reach it (Node.Route).
	KindPrinter = "printer"
	// KindCups is an entry for computers and business systems: a CUPS
	// server on a port of its own, with one printer there, the node
	// itself. It forwards what it receives to every node of To.
	KindCups = "cups"
	// KindCupsOut is an exit: a queue of a CUPS server the job is printed
	// to over IPP (cupsout.go).
	KindCupsOut = "cups-out"
)

The kinds of node of this package.

View Source
const (
	// RouteDirect: the manager sends the job itself (the printer is on a
	// network the manager reaches: the same LAN, or a VPC with Direct
	// Connect or a VPN).
	RouteDirect = "direct"
	// RouteBranch: a bdf printd of the branch fetches the job (INFRA).
	// Not done yet.
	RouteBranch = "branch"
)

Routes of a printer: how its jobs reach it.

View Source
const Path = "/ipp/print"

Path is where the nodes' printers are.

Variables

View Source
var ErrBranch = fmt.Errorf("%w: printers of a branch (route branch) are not supported yet", docflow.ErrUnsupported)

ErrBranch is the error of a printer that a branch's bdf printd is to fetch the jobs of: not done yet.

Functions

func Advertisements

func Advertisements(m *docflow.Manager, nodes []docflow.Node, machine string) []ipp.Advertisement

Advertisements are the DNS-SD services of the CUPS server nodes that are advertised (Node.Advertised) on a port of their own, of nodes (those whose port the process listens on): _ipps._tcp for one with a certificate, else _ipp._tcp, with the subtypes _print (IPP Everywhere) and _universal (AirPrint) and the TXT keys of Mopria, as "<title> @ <machine>" (machine is the computer's name, a label). The services are on the host the caller advertises them on (ipp.Advertise).

Types

type Found

type Found struct {
	// Name is the instance name it is advertised by ("Canon MF Series"),
	// what a node picked from it keeps.
	Name string `json:"name"`
	// URL is where it is printed to: ipp or ipps, its address and port,
	// and its path (rp).
	URL string `json:"url"`
	// Host is its host name on the local links ("printer.local").
	Host string `json:"host"`
	// Model and Note are what it says of itself (the TXT keys ty and
	// note: the note is often where it is).
	Model string `json:"model,omitempty"`
	Note  string `json:"note,omitempty"`
	// Queue tells a queue of a CUPS server (/printers/<queue>,
	// /classes/<class>): a printer a computer or a CUPS server shares.
	Queue bool `json:"queue,omitempty"`
	// AirPrint tells a printer that takes Apple raster (URF), as AirPrint
	// printers do; Everywhere one that takes PWG raster, as IPP
	// Everywhere printers do; Mopria one that says it is certified by
	// Mopria (mopria-certified). The printer node prints to any of them
	// alike, in the best format it takes (PDF first). Secure tells one
	// found as _ipps._tcp (TLS).
	AirPrint   bool `json:"airprint,omitempty"`
	Everywhere bool `json:"everywhere,omitempty"`
	Mopria     bool `json:"mopria,omitempty"`
	Secure     bool `json:"secure,omitempty"`
}

Found is a printer, or a queue of a CUPS server, that Bonjour found, as the editor picks from.

type Queue

type Queue struct {
	Name string `json:"name"`
	// Path is where the queue is on its server: /printers/<name>, or
	// /classes/<name> of a class.
	Path      string `json:"path"`
	Info      string `json:"info,omitempty"`
	Location  string `json:"location,omitempty"`
	MakeModel string `json:"make_model,omitempty"`
	// State is idle, processing or stopped.
	State     string `json:"state"`
	Accepting bool   `json:"accepting"`
	Class     bool   `json:"class,omitempty"`
}

Queue is a queue of a CUPS server, as discoverQueues lists it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL