Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultSocketTimeout = 2 * time.Minute ReceiveBufferSize = 20 * 1024 )
Variables ¶
View Source
var ( DeviceNotFoundError = errors.New("Device not found") ManagerNotFoundError = errors.New("Manager not found") )
View Source
var (
DeviceDisconnectedError = fmt.Errorf("device disconnected")
)
Functions ¶
func StateToString ¶
Types ¶
type Connection ¶
type Connection struct {
Logger *logrus.Entry
Connection *websocket.Conn
ResponseChannel chan ResponseData
ActionChannel chan action.Response
ConnectionParameter *action.Connect
}
func (*Connection) Close ¶
func (c *Connection) Close()
func (*Connection) HandleMessages ¶
func (c *Connection) HandleMessages(ctx context.Context)
func (*Connection) Send ¶
func (c *Connection) Send(content []byte) error
type ConnectionState ¶
type ConnectionState uint8
const ( Disconnected ConnectionState = iota Connected )
type Device ¶
type Device interface {
DeviceID() string
DeviceState() State
DeviceOSName() string
DeviceOSVersion() string
DeviceName() string
DeviceParameter() map[string]string
DeviceType() int
PlatformType() int
TargetVersion() string
// IsAppBundleAvailable(*app.Parameter) (bool, error)
IsAppInstalled(*app.Parameter) (bool, error)
InstallApp(*app.Parameter) error
UninstallApp(*app.Parameter) error
NewContext() context.Context
Cancel()
ConnectionTimeout() time.Duration
SetConnection(*Connection)
Connection() *Connection
IsAppConnected() bool
StartApp(*app.Parameter, string, string) error
StopApp(*app.Parameter) error
Send([]byte) error
StartRecording(string) error
StopRecording() error
GetScreenshot() ([]byte, int, int, error)
HasFeature(string) bool
Execute(string)
Lock() error
Unlock() error
IsLocked() bool
SetLogWriter(LogWriter)
GetLogWriter() LogWriter
Data(string, string)
LogPerformance(checkpoint string, cpu, fps, mem, vertexCount, triangles float64, other string)
Log(string, string, ...interface{})
Error(string, string, ...interface{})
Exception(string, string, ...interface{})
AddActionHandler(action.ActionHandler)
RemoveActionHandler(action.ActionHandler)
ActionHandlers() []action.ActionHandler
RunNativeScript(data []byte)
Passed(result bool)
}
type Handler ¶
type Handler interface {
Name() string
Init(masterUrl string, nodeIdentifier string, authToken *string) error
Start() error
Stop() error
StartDevice(string) error
StopDevice(string) error
GetDevices() ([]Device, error)
RefreshDevices(bool) error
HasDevice(Device) bool
RegisterDevice(data RegisterData) (Device, error)
}
type LogWriter ¶
type LogWriter interface {
LogPerformance(checkpoint string, cpu, fps, mem, vertexCount, triangles float64, other string)
Data(source, data string)
Log(source, format string, params ...interface{})
Error(source, format string, params ...interface{})
TestProtocolId() *uint
Device() interface{}
Parent() LogWriter
Passed(passed bool)
HasPassed() bool
}
type Properties ¶
type Properties struct {
Name string
DeviceID string
Type string
OS string
Architecture string
App string
}
func (*Properties) AreValid ¶
func (p *Properties) AreValid() bool
type RegisterData ¶
type ResponseData ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.