node

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: Apache-2.0 Imports: 20 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	Manager        = "node"
	UpdateInterval = 30 * time.Second
)
View Source
const ConnectionTimeout = 10 * time.Second

Variables

View Source
var (
	ErrManagerNotFound = fmt.Errorf("manager not found")
	ErrDeviceNotFound  = fmt.Errorf("device not found")
)

Functions

func NewMemoryDeviceStore

func NewMemoryDeviceStore(cfg map[string]config.Manager) *deviceStore

Types

type Handler

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

func NewHandler

func NewHandler(log *logrus.Logger, ds storage.Device, nm manager.Nodes, db *gorm.DB) *Handler

func (*Handler) GetDevice

func (h *Handler) GetDevice(deviceID string) (error, manager.NodeIdentifier, device.Device)

func (*Handler) GetDevices

func (h *Handler) GetDevices() ([]device.Device, error)

func (*Handler) Handle

func (h *Handler) Handle(payload events.NodeConnectedPayload)

func (*Handler) HasDevice

func (h *Handler) HasDevice(device2 device.Device) bool

func (*Handler) Init

func (h *Handler) Init(masterUrl, nodeIdentifier string, authToken *string) error

func (*Handler) Name

func (h *Handler) Name() string

func (*Handler) RefreshDevices

func (h *Handler) RefreshDevices(force bool) error

func (*Handler) RegisterDevice

func (h *Handler) RegisterDevice(data device.RegisterData) (device.Device, error)

func (*Handler) Run

func (h *Handler) Run(ctx context.Context, runSocketListener bool) error

func (*Handler) Start

func (h *Handler) Start() error

func (*Handler) StartDevice

func (h *Handler) StartDevice(deviceID string) error

func (*Handler) Stop

func (h *Handler) Stop() error

func (*Handler) StopDevice

func (h *Handler) StopDevice(deviceID string) error

type NodeDevice

type NodeDevice struct {
	generic.Device
	// contains filtered or unexported fields
}

func (*NodeDevice) ConnectionTimeout

func (d *NodeDevice) ConnectionTimeout() time.Duration

func (*NodeDevice) DeviceID

func (d *NodeDevice) DeviceID() string

func (*NodeDevice) DeviceName

func (d *NodeDevice) DeviceName() string

func (*NodeDevice) DeviceOSName

func (d *NodeDevice) DeviceOSName() string

func (*NodeDevice) DeviceOSVersion

func (d *NodeDevice) DeviceOSVersion() string

func (*NodeDevice) DeviceParameter

func (d *NodeDevice) DeviceParameter() map[string]string

func (*NodeDevice) DeviceState

func (d *NodeDevice) DeviceState() device.State

func (*NodeDevice) DeviceType

func (d *NodeDevice) DeviceType() int

func (*NodeDevice) Execute

func (d *NodeDevice) Execute(data string)

func (*NodeDevice) GetNodeID

func (d *NodeDevice) GetNodeID() manager.NodeIdentifier

func (*NodeDevice) GetScreenshot

func (d *NodeDevice) GetScreenshot() ([]byte, int, int, error)

func (*NodeDevice) HasFeature

func (d *NodeDevice) HasFeature(feature string) bool

func (*NodeDevice) InstallApp

func (d *NodeDevice) InstallApp(params *app.Parameter) error

func (*NodeDevice) IsAppConnected

func (d *NodeDevice) IsAppConnected() bool

func (*NodeDevice) IsAppInstalled

func (d *NodeDevice) IsAppInstalled(params *app.Parameter) (bool, error)

func (*NodeDevice) NodeManager

func (d *NodeDevice) NodeManager() manager.Nodes

func (*NodeDevice) PlatformType

func (d *NodeDevice) PlatformType() int

func (*NodeDevice) RunNativeScript

func (d *NodeDevice) RunNativeScript(script []byte)

func (*NodeDevice) Send

func (d *NodeDevice) Send(script []byte) error

func (*NodeDevice) SetDeviceState

func (d *NodeDevice) SetDeviceState(state string)

func (*NodeDevice) StartApp

func (d *NodeDevice) StartApp(params *app.Parameter, sessionId string, nodeUrl string) error

func (*NodeDevice) StartRecording

func (d *NodeDevice) StartRecording(path string) error

func (*NodeDevice) StopApp

func (d *NodeDevice) StopApp(params *app.Parameter) error

func (*NodeDevice) StopRecording

func (d *NodeDevice) StopRecording() error

func (*NodeDevice) TargetVersion

func (d *NodeDevice) TargetVersion() string

func (*NodeDevice) UninstallApp

func (d *NodeDevice) UninstallApp(params *app.Parameter) error

func (*NodeDevice) UpdateDeviceInfos

func (d *NodeDevice) UpdateDeviceInfos(parameter map[string]string)

Jump to

Keyboard shortcuts

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