lp

package
v0.0.0-...-683b059 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package lp provides an API for interacting with the CUPS daemon on Chrome OS via lp/lpstat/lpamin/etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CupsAddPrinter

func CupsAddPrinter(ctx context.Context, printerName, uri, ppd string) error

CupsAddPrinter adds a new printer using CUPS. Returns an error if the ppd is empty or lpadmin fails.

func CupsRemovePrinter

func CupsRemovePrinter(ctx context.Context, printerName string) error

CupsRemovePrinter removes the printer that was configured for testing.

func CupsStartPrintJob

func CupsStartPrintJob(ctx context.Context, printerName, toPrint string) (job string, err error)

CupsStartPrintJob starts a new print job for the file toPrint. Returns the ID of the newly created job if successful.

func JobCompleted

func JobCompleted(ctx context.Context, printerName, job string) (bool, error)

JobCompleted checks whether or not the given print job has been marked as completed.

func PrinterNameByURI

func PrinterNameByURI(ctx context.Context, uri string) (name string, err error)

PrinterNameByURI runs the lpstat command to search for a configured printer which corresponds to uri. Return the name of the matching printer if found.

Types

This section is empty.

Jump to

Keyboard shortcuts

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