button

package
v0.64.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: AGPL-3.0 Imports: 9 Imported by: 2

Documentation

Overview

Package button defines a button on your machine.

Package button contains a gRPC based button client.

Package button contains a gRPC based button service server.

Index

Constants

View Source
const SubtypeName = "button"

SubtypeName is a constant that identifies the component resource API string.

Variables

View Source
var API = resource.APINamespaceRDK.WithComponentType(SubtypeName)

API is a variable that identifies the component resource API.

Functions

func Named

func Named(name string) resource.Name

Named is a helper for getting the named grippers's typed resource name.

func NamesFromRobot

func NamesFromRobot(r robot.Robot) []string

NamesFromRobot is a helper for getting all gripper names from the given Robot.

func NewRPCServiceServer

func NewRPCServiceServer(coll resource.APIResourceCollection[Button]) interface{}

NewRPCServiceServer constructs an gripper gRPC service server. It is intentionally untyped to prevent use outside of tests.

Types

type Button

type Button interface {
	resource.Resource

	// Push pushes the button.
	// This will block until done or a new operation cancels this one.
	Push(ctx context.Context, extra map[string]interface{}) error
}

A Button represents a physical button.

func FromDependencies

func FromDependencies(deps resource.Dependencies, name string) (Button, error)

FromDependencies is a helper for getting the named button component from a collection of dependencies.

func FromRobot

func FromRobot(r robot.Robot, name string) (Button, error)

FromRobot is a helper for getting the named Button from the given Robot.

func NewClientFromConn

func NewClientFromConn(
	ctx context.Context,
	conn rpc.ClientConn,
	remoteName string,
	name resource.Name,
	logger logging.Logger,
) (Button, error)

NewClientFromConn constructs a new Client from connection passed in.

Directories

Path Synopsis
Package fake implements a fake button.
Package fake implements a fake button.
Package register registers all relevant buttons and also API specific functions
Package register registers all relevant buttons and also API specific functions

Jump to

Keyboard shortcuts

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