Documentation
¶
Overview ¶
Package ipptest is a fake CUPS scheduler on loopback for tests: the queues a test sets answer CUPS-Get-Printers, Get-Printer-Attributes and CUPS-Get-Default, CUPS-Create-Local-Printer adds one, and Print-Job records what it is sent. It also stands in for a network printer answering its own attributes. Nothing reaches a real printer or the host's cupsd.
Index ¶
- type Job
- type Server
- func (s *Server) Client() *ipp.Client
- func (s *Server) Created(name string) string
- func (s *Server) Hold()
- func (s *Server) Jobs() []Job
- func (s *Server) Ops() []uint16
- func (s *Server) Release()
- func (s *Server) Replies() int
- func (s *Server) SetDefault(name string)
- func (s *Server) SetPrinter(name string, attrs ...ipp.Attr)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
Job is one Print-Job the scheduler took: the queue its URI named, its attribute groups and its document.
type Server ¶
type Server struct {
// Addr is host:port, for ipp.NewClient.
Addr string
// contains filtered or unexported fields
}
Server is the fake scheduler.
func StartDevice ¶
StartDevice runs a network printer on IPv4 loopback, over TLS with a self-signed certificate (ipps) or plain HTTP (ipp), answering its attributes at any URI.
func StartDeviceAt ¶
StartDeviceAt is StartDevice listening at addr ("[::1]:0" for IPv6 loopback).
func (*Server) Created ¶
Created is the device URI of each queue CUPS-Create-Local-Printer made, by name.
func (*Server) Ops ¶
Ops are the operations asked for, in order, and Replies how many answers were sent.
func (*Server) Release ¶
func (s *Server) Release()
Release lets the held requests and every later one through.
func (*Server) SetDefault ¶
SetDefault makes name the scheduler's default destination.