ducky/devices

Paddy 2015-11-12 Parent:b6494e1a499e Child:408abf6e48d3

1:600326d50e74 Go to Latest

ducky/devices/devices.go

Move DeviceType to its own file, add helper and constants. Make a device_type.go file, to avoid a mess in the devices.go file. Move the DeviceType definition over to the new file. Also, while we're here, set up a few of the contstants we know we'll need. These are the DeviceTypes we intend to support, such as Android phones, Android tablets, and Chrome extensions. Also, set up a helper method that will determine whether a DeviceType is "valid", i.e. if we have a constant defined for it. DeviceTypes, in general, are mostly intended to be used (at the moment, at least) to customise how we display devices to users. Basically, they allow us to display an at least semi-accurate depiction of the device.

History
     1.1 --- a/devices.go	Thu Nov 12 20:33:26 2015 -0800
     1.2 +++ b/devices.go	Thu Nov 12 22:17:15 2015 -0800
     1.3 @@ -55,10 +55,6 @@
     1.4  	return result
     1.5  }
     1.6  
     1.7 -// DeviceType is an enum specifying which type of Device it is. Usually,
     1.8 -// this is something like `android_phone` or `android_tablet`.
     1.9 -type DeviceType string
    1.10 -
    1.11  // DeviceChange represents a set of changes to a Device that will be used
    1.12  // to update a Device.
    1.13  type DeviceChange struct {