lorgnette

package
v0.0.0-...-9474aff Latest Latest
Warning

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

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

Documentation

Overview

Package lorgnette provides an interface to talk to lorgnette over D-Bus.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunScan

func RunScan(ctx context.Context, startScanRequest *lpb.StartScanRequest, tmpDir string) (string, error)

RunScan takes in the scan request and temporary directory needed to perform a scan operation Instantiates a new lorgnette instance and processes a complete scan job of a single image It returns the scan path of the scanned image

func StopService

func StopService(ctx context.Context) error

StopService finds the running lorgnette process and kills it.

Types

type Lorgnette

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

Lorgnette is used to interact with the lorgnette process over D-Bus. For detailed spec of each D-Bus method, please review src/platform2/lorgnette/dbus_bindings/org.chromium.lorgnette.Manager.xml

func New

func New(ctx context.Context) (*Lorgnette, error)

New connects to lorgnette via D-Bus and returns a Lorgnette object. The returned object will be registered for ScanStatusChanged signals.

func (*Lorgnette) GetNextImage

func (l *Lorgnette) GetNextImage(ctx context.Context, request *lpb.GetNextImageRequest, outFD uintptr) (*lpb.GetNextImageResponse, error)

GetNextImage calls lorgnette's GetNextImage method and returns the remote response.

func (*Lorgnette) ListScanners

func (l *Lorgnette) ListScanners(ctx context.Context) ([]*lpb.ScannerInfo, error)

ListScanners calls lorgnette's ListScanners() method and returns the (possibly empty) list of ScannerInfo objects from the response.

func (*Lorgnette) StartScan

func (l *Lorgnette) StartScan(ctx context.Context, request *lpb.StartScanRequest) (*lpb.StartScanResponse, error)

StartScan calls lorgnette's StartScan method and returns the remote response.

func (*Lorgnette) WaitForScanCompletion

func (l *Lorgnette) WaitForScanCompletion(ctx context.Context, uuid string) error

WaitForScanCompletion waits for a ScanStatusChanged signal that matches uuid and has a terminal status. Intermediate statuses are ignored.

Jump to

Keyboard shortcuts

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