Skip to content

0ptimusGrime/plugwork

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

plugwork (working title)

The general flow of this is:

Something satisfying the Readable interface accepts user input and emits message.Instruction structs onto a read queue.

A go func picks messages off of this read queue, and then dispatches it to any devices registred in the device.Set. Each of these devices will then transform the generic message.Instruction struct into a device-specific implementation -- since I don't imagine that all devices will have compatible implementations of a given abstract feature.

This transformation is done by mapping constants defined in the capabilities package to a specific transform function. The result of this transform function is what's ultimately emitted to the end device.

usage:

in one terminal, run nc -l -u 127.0.0.1:9999

in another, simply:

$ go run main.go
Starting console reader. ctrl+c to exit
> vibrate
> sending message [vibrate] to 1 devices...
sending messsage vibrate to device UDPVibrator

You should the UDP message emitted in the terminal running netcat

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages