ipp

package
v0.0.0-...-e3efb14 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find(ctx context.Context) (chan *Printer, error)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(uri string) *Client

func (*Client) JobAttributes

func (c *Client) JobAttributes(ctx context.Context, job int) (*JobAttributes, error)

func (*Client) PrintJob

func (c *Client) PrintJob(ctx context.Context, filename, mime string, reader io.Reader) (int, error)

func (*Client) PrintJobFile

func (c *Client) PrintJobFile(ctx context.Context, filename, mime string) (int, error)

func (*Client) PrinterAttributes

func (c *Client) PrinterAttributes(ctx context.Context) (*PrinterAttributes, error)

func (*Client) SendRequest

func (c *Client) SendRequest(ctx context.Context, in *goipp.Message, payload io.Reader) (*goipp.Message, error)

func (*Client) WatchJobState

func (c *Client) WatchJobState(ctx context.Context, job int, state chan<- JobState) func() error

func (*Client) WatchPrinterState

func (c *Client) WatchPrinterState(ctx context.Context, state chan<- PrinterState) func() error

type JobAttributes

type JobAttributes struct {
	State       JobState
	StateReason string
}

type JobState

type JobState int
const (
	JobPending           JobState = 3
	JobPendingHeld       JobState = 4
	JobProcessing        JobState = 5
	JobProcessingStopped JobState = 6
	JobCanceled          JobState = 7
	JobAborted           JobState = 8
	JobCompleted         JobState = 9
)

func (JobState) String

func (s JobState) String() string

type Printer

type Printer struct {
	Name  string
	State PrinterState
	URI   string
}

func ParseFindEntry

func ParseFindEntry(entry *zeroconf.ServiceEntry) *Printer

type PrinterAttributes

type PrinterAttributes struct {
	Name                  string
	Info                  string
	State                 PrinterState
	StateReason           string
	QueuedJobCount        int
	ColorSupported        bool
	OperationsSupported   []goipp.Op
	PageDeliverySupported []string
}

type PrinterState

type PrinterState int
const (
	PrinterIdle       PrinterState = 3
	PrinterProcessing PrinterState = 4
	PrinterStopped    PrinterState = 5
)

func (PrinterState) String

func (s PrinterState) String() string

Jump to

Keyboard shortcuts

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