trace

package
v1.7.0-dev-20190911 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2019 License: Apache-2.0 Imports: 25 Imported by: 8

Documentation

Overview

Package trace holds the code for taking a capture in the robot system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, store *stash.Client, manager Manager, tempDir file.Path) error

Run starts new trace client if any hardware is available.

func Serve

func Serve(ctx context.Context, grpcServer *grpc.Server, manager Manager) error

Serve wraps a manager in a grpc server.

Types

type ActionHandler

type ActionHandler func(context.Context, *Action) error

ActionHandler is a function that handles a stream of Actions.

type Manager

type Manager interface {
	// Search invokes handler with each output that matches the query.
	Search(ctx context.Context, query *search.Query, handler ActionHandler) error
	// Register a handler that will accept incoming tasks.
	Register(ctx context.Context, host *device.Instance, target *device.Instance, handler TaskHandler) error
	// Do asks the manager to send a task to a device.
	Do(ctx context.Context, device string, input *Input) (string, error)
	// Update adjusts the state of an action.
	Update(ctx context.Context, action string, status job.Status, output *Output) error
}

Manager is the interface to a trace manager.

func NewLocal

func NewLocal(ctx context.Context, library record.Library, jobManager job.Manager) (Manager, error)

NewLocal builds a new local manager.

func NewRemote

func NewRemote(ctx context.Context, conn *grpc.ClientConn) Manager

NewRemote returns a Worker that talks to a remote grpc trace service.

type TaskHandler

type TaskHandler func(context.Context, *Task) error

TaskHandler is a function that handles a stream of Tasks.

Jump to

Keyboard shortcuts

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