Documentation
¶
Index ¶
- Constants
- Variables
- func GetUnityEditorPath(editorPath string, projectVersion string) string
- func GetUsedUnityVersion(projectDir string) (string, error)
- type Deps
- type Device
- func (d *Device) ConnectionTimeout() time.Duration
- func (d *Device) DeviceIP() net.IP
- func (d *Device) DeviceState() device.State
- func (d *Device) HandleManagerConnection()
- func (d *Device) InstallApp(_ *app.Parameter) error
- func (d *Device) IsAppConnected() bool
- func (d *Device) IsAppInstalled(_ *app.Parameter) (bool, error)
- func (d *Device) SetDeviceState(state string)
- func (d *Device) StartApp(_ *device.DeviceConfig, _ *app.Parameter, sessionId string, nodeUrl string) error
- func (d *Device) StopApp(_ *app.Parameter) error
- func (d *Device) UninstallApp(_ *app.Parameter) error
- func (d *Device) UnityLogStartListening()
- func (d *Device) UnityLogStopListening()
- type Handler
- func (m *Handler) Init(masterUrl, nodeIdentifier string, authToken *string) error
- func (m *Handler) Name() string
- func (m *Handler) RefreshDevices(_ bool) error
- func (m *Handler) RegisterDevice(data device.RegisterData) (device.Device, error)
- func (m *Handler) Start() error
- func (m *Handler) StartDevice(deviceID string) error
- func (m *Handler) Stop() error
- func (m *Handler) StopDevice(deviceID string) error
Constants ¶
const ConnectionTimeout = 60 * time.Minute
const (
Manager = "unity_editor"
)
const (
StartupTimeout = 2 * time.Minute
)
Variables ¶
var (
ErrorGetProjectVersion = errors.New("could not determine the project / unity version")
)
Functions ¶
func GetUnityEditorPath ¶ added in v1.0.0
GetUnityEditorPath is the editor binary of the version below editorPath. Only macOS is supported, other systems give an empty path.
func GetUsedUnityVersion ¶ added in v1.0.0
GetUsedUnityVersion reads the editor version of the Unity project.
Types ¶
type Deps ¶ added in v1.2.0
type Deps struct {
Runner device.CommandRunner
Clock device.Clock
// GOOS is the operating system the editor runs on, runtime.GOOS by default.
GOOS string
}
Deps are the external collaborators of the Handler. Zero fields get the real implementations.
type Device ¶
Device is a Unity editor that registered itself with the hub. It supports the Identity, AppManager (start and stop only), AppConnection, Locker, TestLogger and ActionHandlerRegistry roles; recording and screenshots are not supported.
func (*Device) ConnectionTimeout ¶
func (*Device) DeviceState ¶
func (*Device) HandleManagerConnection ¶ added in v1.0.0
func (d *Device) HandleManagerConnection()
HandleManagerConnection serves the editor's websocket until it closes. The device is booted while the connection lives.
func (*Device) IsAppConnected ¶
func (*Device) IsAppInstalled ¶
IsAppInstalled is always true: the editor runs the project, there is nothing to install.
func (*Device) SetDeviceState ¶
SetDeviceState sets the state from its name, see device.ParseState.
func (*Device) UnityLogStartListening ¶ added in v1.0.0
func (d *Device) UnityLogStartListening()
UnityLogStartListening follows the editor's log file until UnityLogStopListening.
func (*Device) UnityLogStopListening ¶ added in v1.0.0
func (d *Device) UnityLogStopListening()
type Handler ¶
func NewHandlerWithDeps ¶ added in v1.2.0
func (*Handler) RefreshDevices ¶
RefreshDevices marks editors that were silent for too long as shut down and stores the devices that changed.
func (*Handler) RegisterDevice ¶
RegisterDevice adds an editor that connected, or refreshes the known one, and serves its websocket in the background.