Documentation ¶
Overview ¶
Package lorgnette provides an interface to talk to lorgnette over D-Bus.
Index ¶
- func RunScan(ctx context.Context, startScanRequest *lpb.StartScanRequest, tmpDir string) (string, error)
- func StopService(ctx context.Context) error
- type Lorgnette
- func (l *Lorgnette) GetNextImage(ctx context.Context, request *lpb.GetNextImageRequest, outFD uintptr) (*lpb.GetNextImageResponse, error)
- func (l *Lorgnette) ListScanners(ctx context.Context) ([]*lpb.ScannerInfo, error)
- func (l *Lorgnette) StartScan(ctx context.Context, request *lpb.StartScanRequest) (*lpb.StartScanResponse, error)
- func (l *Lorgnette) WaitForScanCompletion(ctx context.Context, uuid string) error
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 ¶
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 ¶
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 ¶
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.