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
- Variables
- func Named(name string) resource.Name
- func NamesFromRobot(r robot.Robot) []string
- func NewRPCServiceServer(coll resource.APIResourceGetter[Button], logger logging.Logger) interface{}
- type Button
- func FromDependencies(deps resource.Dependencies, name string) (Button, error)deprecated
- func FromProvider(provider resource.Provider, name string) (Button, error)
- func FromRobot(r robot.Robot, name string) (Button, error)deprecated
- func NewClientFromConn(ctx context.Context, conn rpc.ClientConn, remoteName string, ...) (Button, error)
Constants ¶
const SubtypeName = "button"
SubtypeName is a constant that identifies the component resource API string.
Variables ¶
var API = resource.APINamespaceRDK.WithComponentType(SubtypeName)
API is a variable that identifies the component resource API.
Functions ¶
func NamesFromRobot ¶
NamesFromRobot is a helper for getting all gripper names from the given Robot.
func NewRPCServiceServer ¶
func NewRPCServiceServer(coll resource.APIResourceGetter[Button], logger logging.Logger) 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.
Push(ctx context.Context, extra map[string]interface{}) error
}
A Button represents a physical button. For more information, see the Button component docs.
Push example:
myButton, err := switch.FromProvider(machine, "my_button") err := myButton.Push(context.Background(), nil)
For more information, see the Push method docs.
func FromDependencies
deprecated
func FromDependencies(deps resource.Dependencies, name string) (Button, error)
Deprecated: FromDependencies is a helper for getting the named button component from a collection of dependencies. Use FromProvider instead.
func FromProvider ¶ added in v0.98.0
FromProvider is a helper for getting the named Button from a resource Provider (collection of Dependencies or a Robot).