device

package
Version: v0.0.0-...-b2c3d2c Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: ISC Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Debug bool

Functions

func AddDeviceSetupCallback

func AddDeviceSetupCallback(cb DeviceSetupCallback)

func AllDevices

func AllDevices() map[string]*Device

func FindDevices

func FindDevices() error

func SetupDevices

func SetupDevices() error

Types

type Device

type Device struct {
	DeviceID       string
	Info           deviceInfo
	LastScreenshot struct {
		Time time.Time
		File string
	}
	Online     bool
	SSHRunning bool
	VNCRunning bool
}

func GetDeviceByID

func GetDeviceByID(deviceID string) *Device

find an existing device by its ID

func NewDevice

func NewDevice(deviceID string, info deviceInfo) (dev *Device, err error)

create a new device and a directory for it

func (*Device) CPUMHz

func (dev *Device) CPUMHz() measure.Megahertz

func (*Device) CombinedCPUMHz

func (dev *Device) CombinedCPUMHz() measure.Megahertz

CPU MHz multiplied to consider all CPUs/cores

func (*Device) Debug

func (dev *Device) Debug(f string, message ...interface{})

log debug

func (*Device) GetDirectory

func (dev *Device) GetDirectory() string

get device directory

func (*Device) GetFilePath

func (dev *Device) GetFilePath(fileName string) string

get device file path

func (*Device) GetIP

func (dev *Device) GetIP() net.IP

get IP

func (*Device) GetLastScreenshot

func (dev *Device) GetLastScreenshot() string

find the last screenshot

func (*Device) HardwareInOrder

func (dev *Device) HardwareInOrder() (hardware []hardwarePair)

func (*Device) Log

func (dev *Device) Log(f string, message ...interface{})

log

func (*Device) PrettyHardwareInOrder

func (dev *Device) PrettyHardwareInOrder() (hardware []hardwarePair)

func (*Device) PrettySoftwareInOrder

func (dev *Device) PrettySoftwareInOrder() (software []softwarePair)

func (*Device) RAMMBytes

func (dev *Device) RAMMBytes() measure.Megabytes

func (*Device) ReadInfo

func (dev *Device) ReadInfo() error

read info from file

func (*Device) SoftwareInOrder

func (dev *Device) SoftwareInOrder() (software []softwarePair)

func (*Device) Warn

func (dev *Device) Warn(f string, warning ...interface{})

log warning

func (*Device) WriteInfo

func (dev *Device) WriteInfo() error

write info to file

type DeviceCollection

type DeviceCollection []*Device

func (DeviceCollection) Len

func (devs DeviceCollection) Len() int

func (DeviceCollection) Less

func (devs DeviceCollection) Less(i, j int) bool

func (DeviceCollection) Swap

func (devs DeviceCollection) Swap(i, j int)

type DeviceSetupCallback

type DeviceSetupCallback func(dev *Device) error

Jump to

Keyboard shortcuts

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