servod

package
v0.0.0-...-8501283 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package servod provides functions to manage connection and communication with servod daemon on servo-host.

Index

Constants

View Source
const (

	// ImageUsbkeyDev sets GPIO control for USB device on servo-host
	ImageUsbkeyDev = "image_usbkey_dev"
	// ImageUsbkeyDirection sets GPIO control for USB multiplexer
	ImageUsbkeyDirection = "image_usbkey_direction"
	// ImageUsbkeyTowardsDUT sets GPIO control value that causes USB drive to be attached to DUT.
	ImageUsbkeyTowardsDUT = "dut_sees_usbkey"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

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

Pool is a pool of servod to reuse.

Servo are pooled by the `address:port|remote` they are connected to.

Users should call Get, which returns a instance from the pool if available, or creates and returns a new one. The returned servod is not guaranteed to be good, e.g., the connection may have broken while the Client was in the pool.

The user should not close the servod as Pool will close it at the end.

The user should Close the pool after use, to free any resources in the pool.

func NewPool

func NewPool() *Pool

NewPool returns a new Pool. The provided ssh config is used for new SSH connections if pool has none to reuse.

func (*Pool) Close

func (p *Pool) Close() error

Close closes all active servodes.

func (*Pool) Get

func (p *Pool) Get(servoAddr string, servodPort int32, getParams getServoParams) (*servod, error)

Get provides servod from cache or initiate new one.

Jump to

Keyboard shortcuts

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