Documentation ¶
Overview ¶
Package buttplugtest provides utilities for buttplug testing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultAddDeviceMessage can be used to simulate adding a Launch. DefaultAddDeviceMessage = &message.Device{ ID: 0, DeviceName: "Launch", DeviceIndex: 3, DeviceMessages: []string{"FleshlightLaunchFW12Cmd", "KiirooCmd", "RawCmd", "StopDeviceCmd"}, } // DefaultRemoveDeviceMessage can be used to remove the added Launch. DefaultRemoveDeviceMessage = &message.Device{ ID: 0, DeviceIndex: 3, } )
View Source
var DefaultTestServer = &TestServer{ InitialDevices: []message.Device{ { DeviceName: "TestDevice 1", DeviceIndex: 0, DeviceMessages: []string{"SingleMotorVibrateCmd", "RawCmd", "KiirooCmd", "StopDeviceCmd"}, }, { DeviceName: "TestDevice 2", DeviceIndex: 1, DeviceMessages: []string{"SingleMotorVibrateCmd", "LovenseCmd", "StopDeviceCmd"}, }, { DeviceName: "Launch", DeviceIndex: 2, DeviceMessages: []string{"FleshlightLaunchFW12Cmd", "KiirooCmd", "RawCmd", "StopDeviceCmd"}, }, }, }
DefaultTestServer is a TestServer with some predefined devices.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
Conn is an established websocket connection with the testserver.
func (*Conn) AddDevice ¶
AddDevice will send the a message to the client that the given device has been added.
func (*Conn) ReadMessages ¶
ReadMessages will read the messages from the websocket to be read and handled.
func (*Conn) RemoveDevice ¶
RemoveDevice will send the a message to the client that the given device has been removed.
func (*Conn) SendScanningFinished ¶
func (c *Conn) SendScanningFinished()
SendScanningFinished will send a message to the client that scanning is finished.
type TestServer ¶
TestServer is a mock of a Buttplug server.
func (*TestServer) ServeHTTP ¶
func (t *TestServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.