buttplug

package module
v0.0.0-...-0b2e068 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2019 License: BSD-3-Clause Imports: 14 Imported by: 2

README

buttplug-go

Golang library for accessing buttplug servers

Documentation

Index

Constants

View Source
const SYSTEM_MSG message.Id = 0

Variables

This section is empty.

Functions

This section is empty.

Types

type Buttplug

type Buttplug interface {
	Send(messages ...Message) error
	Recieve() <-chan Message
	Error() <-chan error
	Close(timeout time.Duration) error
}

func Dial

func Dial(url string) (Buttplug, error)

type Client

type Client string

type CommandFailure

type CommandFailure struct{}

func (*CommandFailure) Error

func (*CommandFailure) Error() string

type Device

type Device interface {
	DeviceName() device.Name
	DeviceIndex() device.Index
	Stop() error
}

type DeviceError

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

func (*DeviceError) Error

func (deviceError *DeviceError) Error() string

type DeviceManager

type DeviceManager interface {
	Scan(duration time.Duration) *sync.WaitGroup
	StopAll() bool
	Devices() []Device
	Raws() []Raw
	Vibrators() []Vibrate
	Linears() []Linear
	Rotators() []Rotate
	Kiiroos() []Kiiroo
	FleshlightLaunches() []FleshlightLaunch
	Lovenses() []Lovense
	VorzeA10Cyclones() []VorzeA10Cyclone
}

func NewDeviceManager

func NewDeviceManager(handler Handler) DeviceManager

type FleshlightLaunch

type FleshlightLaunch interface {
	DeviceName() device.Name
	DeviceIndex() device.Index
	FleshlightCmd(position, speed int) error
	Stop() error
}

type Handler

type Handler interface {
	Handshake(Client) (Server, error)
	Ping() bool
	System() <-chan Message
	Call(Message) (Message, error)
	Register(Message) (<-chan Message, error)
	Clear(message.Id)
}

func NewHandler

func NewHandler(buttplug Buttplug) Handler

type Kiiroo

type Kiiroo interface {
	DeviceName() device.Name
	DeviceIndex() device.Index
	KiirooCmd(string) error
	Stop() error
}

type Linear

type Linear interface {
	DeviceName() device.Name
	DeviceIndex() device.Index
	VectorCount() device.FeatureCount
	Vector(...device.Vector) error
	Stop() error
}

type Lovense

type Lovense interface {
	DeviceName() device.Name
	DeviceIndex() device.Index
	LovenseCmd(string) error
	Stop() error
}

type Message

type Message interface {
	Id() message.Id
	Serilize() interface{}
}

type MessageIdReused

type MessageIdReused struct{}

func (*MessageIdReused) Error

func (*MessageIdReused) Error() string

type Raw

type Raw interface {
	DeviceName() device.Name
	DeviceIndex() device.Index
	Cmd([]byte) error
	Stop() error
}

type Rotate

type Rotate interface {
	DeviceName() device.Name
	DeviceIndex() device.Index
	RotateCount() device.FeatureCount
	Rotate(...device.Rotation) error
	Stop() error
}

type Server

type Server interface {
	ServerName() server.Name
	MajorVersion() server.MajorVersion
	MinorVersion() server.MinorVersion
	BuildVersion() server.BuildVersion
	MaxPingTime() server.MaxPingTime
}

type Timeout

type Timeout struct{}

func (*Timeout) Error

func (*Timeout) Error() string

type UnexpectedWebsocketMessageType

type UnexpectedWebsocketMessageType struct{}

func (*UnexpectedWebsocketMessageType) Error

type UnknownMessageType

type UnknownMessageType struct{}

func (*UnknownMessageType) Error

func (*UnknownMessageType) Error() string

type Vibrate

type Vibrate interface {
	DeviceName() device.Name
	DeviceIndex() device.Index
	VibrateCount() device.FeatureCount
	Vibrate(...device.Speed) error
	Stop() error
}

type VorzeA10Cyclone

type VorzeA10Cyclone interface {
	DeviceName() device.Name
	DeviceIndex() device.Index
	VorzeA10CycloneCmd(speed int, direction device.Direction) error
	Stop() error
}

Jump to

Keyboard shortcuts

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