mirror of
https://github.com/jwetzell/showbridge-docs.git
synced 2026-05-13 21:14:17 +00:00
add language hints to code blocks
This commit is contained in:
@@ -13,7 +13,7 @@ The `db.sqlite` module can open/create SQLite databases
|
||||
|
||||
### Example snippet
|
||||
Opens an in-memory SQLite database
|
||||
```
|
||||
```yaml
|
||||
- id: db
|
||||
type: db.sqlite
|
||||
params:
|
||||
|
||||
@@ -12,7 +12,7 @@ The `http.server` module emits a message for every HTTP request that is made to
|
||||
|
||||
### Example
|
||||
Start an HTTP server listening on port 3000
|
||||
```
|
||||
```yaml
|
||||
- id: httpServer
|
||||
type: http.server
|
||||
params:
|
||||
|
||||
@@ -19,7 +19,7 @@ The `midi.input` module connects to a midi device (or virtual device) and emits
|
||||
|
||||
### Example
|
||||
Open a MIDI connection to `Logic Pro Virtual Out`.
|
||||
```
|
||||
```yaml
|
||||
- id: midiInput
|
||||
type: midi.input
|
||||
params:
|
||||
|
||||
@@ -18,7 +18,7 @@ The `midi.output` module connects to a midi device (or virtual device) and allow
|
||||
|
||||
### Example
|
||||
Open a MIDI connection to `Logic Pro Virtual In`.
|
||||
```
|
||||
```yaml
|
||||
- id: midiOutput
|
||||
type: midi.output
|
||||
params:
|
||||
|
||||
@@ -15,7 +15,7 @@ The `mqtt.client` module connects to a MQTT broker and emits a message messages
|
||||
|
||||
### Example
|
||||
Open a mqtt connection to `test.mosquitto.org` subscribing to the `showbridge` topic.
|
||||
```
|
||||
```yaml
|
||||
- id: mqttClient
|
||||
type: mqtt.client
|
||||
params:
|
||||
|
||||
@@ -12,7 +12,7 @@ This module connects to a [NATS](https://nats.io/) server and subscribes to a su
|
||||
|
||||
### Example
|
||||
Connect to a local NATS server and subscribe to the `events` subject
|
||||
```
|
||||
```yaml
|
||||
- id: natsClient
|
||||
type: nats.client
|
||||
params:
|
||||
|
||||
@@ -12,7 +12,7 @@ This module starts a NATS server that listens for incoming connections.
|
||||
|
||||
### Example
|
||||
Start a local NATS server listening on port 5555
|
||||
```
|
||||
```yaml
|
||||
- id: httpServer
|
||||
type: http.server
|
||||
params:
|
||||
|
||||
@@ -20,7 +20,7 @@ The `net.tcp.client` module connects to TCP server and emits messages based on t
|
||||
|
||||
### Example
|
||||
Open a TCP connection to `127.0.0.1` port 8888, any incoming data will be split on line-feed (`\n`)
|
||||
```
|
||||
```yaml
|
||||
- id: tcpClient
|
||||
type: net.tcp.client
|
||||
params:
|
||||
|
||||
@@ -20,7 +20,7 @@ The `net.tcp.server` module emits a message messages based on the data it receiv
|
||||
|
||||
### Example
|
||||
Start a TCP server listening on port 8888, incoming data will be split on line-feed (`\n`)
|
||||
```
|
||||
```yaml
|
||||
- id: tcpServer
|
||||
type: net.tcp.server
|
||||
params:
|
||||
|
||||
@@ -13,7 +13,7 @@ The `net.udp.client` module sends messages to a the configured `host` and `port`
|
||||
|
||||
### Example
|
||||
setup up a UDP client that will send UDP packets to `127.0.0.1` on port 8888
|
||||
```
|
||||
```yaml
|
||||
- id: udpClient
|
||||
type: net.udp.client
|
||||
params:
|
||||
|
||||
@@ -12,7 +12,7 @@ sidebar:
|
||||
|
||||
### Example
|
||||
Listen to the mDNS multicast address on port 5353
|
||||
```
|
||||
```yaml
|
||||
- id: mdnsListener
|
||||
type: net.udp.multicast
|
||||
params:
|
||||
|
||||
@@ -14,7 +14,7 @@ The `net.udp.server` module emits a message for every incoming UDP datagram.
|
||||
|
||||
### Example
|
||||
Start a UDP server listening on port 8888 and only on `127.0.0.1`
|
||||
```
|
||||
```yaml
|
||||
- id: udpServer
|
||||
type: net.udp.server
|
||||
params:
|
||||
|
||||
@@ -10,8 +10,7 @@ sidebar:
|
||||
This module listens on the [PosiStageNet](http://posistage.net/) multicast address and emits tracker states anytime a new PSN message is received.
|
||||
|
||||
### Example
|
||||
List
|
||||
```
|
||||
```yaml
|
||||
- id: psnClient
|
||||
type: psn.client
|
||||
```
|
||||
@@ -14,7 +14,7 @@ The `redis.client` module connects to a Redis server. This module does not produ
|
||||
|
||||
### Example
|
||||
Connect to a Redis server running on `localhost` at port `6379`.
|
||||
```
|
||||
```yaml
|
||||
- id: redisClient
|
||||
type: redis.client
|
||||
params:
|
||||
|
||||
@@ -26,7 +26,7 @@ The `serial.client` module connects to a serial device and emits a message messa
|
||||
|
||||
### Example
|
||||
Open a serial connection to `/dev/ttyS0` with a buad rate of `115200`, any incoming data will be split on line-feed (`\n`)
|
||||
```
|
||||
```yaml
|
||||
- id: serialClient
|
||||
type: serial.client
|
||||
params:
|
||||
|
||||
@@ -14,7 +14,7 @@ This module starts a [SIP](https://en.wikipedia.org/wiki/Session_Initiation_Prot
|
||||
|
||||
### Example
|
||||
Start a UDP SIP server listening on port 5060
|
||||
```
|
||||
```yaml
|
||||
- id: sipCallServer
|
||||
type: sip.call.server
|
||||
params:
|
||||
|
||||
@@ -16,7 +16,7 @@ This module starts a [SIP](https://en.wikipedia.org/wiki/Session_Initiation_Prot
|
||||
|
||||
### Example
|
||||
Start a UDP SIP server listening on port 5060 that will emit events whenever the user presses the `#` key on their phone during a call
|
||||
```
|
||||
```yaml
|
||||
- id: sipDTMFServer
|
||||
type: sip.dtmf.server
|
||||
params:
|
||||
|
||||
@@ -11,7 +11,7 @@ The `time.interval` module emits a message at a specified duration. Sending any
|
||||
|
||||
### Example snippet
|
||||
Emits a message every 3 seconds
|
||||
```
|
||||
```yaml
|
||||
- id: every3Secs
|
||||
type: time.interval
|
||||
params:
|
||||
|
||||
@@ -11,7 +11,7 @@ The `time.timer` module emits only one message after a specified duration. Sendi
|
||||
|
||||
### Example snippet
|
||||
Emits a message 5 seconds after the module is initialized
|
||||
```
|
||||
```yaml
|
||||
- id: 5secs
|
||||
type: time.timer
|
||||
params:
|
||||
|
||||
@@ -10,6 +10,6 @@ sidebar:
|
||||
This processor will decode incoming bytes into an ArtNet packet. This processor will return an error if the message being processed is not an array of bytes.
|
||||
|
||||
### Example
|
||||
```
|
||||
```yaml
|
||||
- type: artnet.packet.decode
|
||||
```
|
||||
@@ -9,6 +9,6 @@ sidebar:
|
||||
This processor will encode an ArtNet packet into an array of bytes. This processor will return an error if the message being processed is not an ArtNet packet.
|
||||
|
||||
### Example
|
||||
```
|
||||
```yaml
|
||||
- type: artnet.packet.encode
|
||||
```
|
||||
@@ -12,7 +12,7 @@ The `db.query` processor will issue a query to the specified module and return t
|
||||
- **query**: the query to execute.
|
||||
### Example
|
||||
Issue a `SELECT` statement to a module with id `sqlite`.
|
||||
```
|
||||
```yaml
|
||||
- type: db.query
|
||||
params:
|
||||
module: sqlite
|
||||
|
||||
@@ -9,6 +9,6 @@ sidebar:
|
||||
This processor will log information about the message being processed to the console. This processor does not modify the message in any way and will pass the message through to the next processor in the chain.
|
||||
|
||||
### Example
|
||||
```
|
||||
```yaml
|
||||
- type: debug.log
|
||||
```
|
||||
@@ -11,6 +11,6 @@ This processor will only pass messages through if the value of the message has c
|
||||
|
||||
|
||||
### Example
|
||||
```
|
||||
```yaml
|
||||
- type: filter.change
|
||||
```
|
||||
@@ -12,7 +12,7 @@ The `filter.expr` processor evaluates an [Expr expression](https://expr-lang.org
|
||||
|
||||
### Example
|
||||
Match a payload great than or equal to 0
|
||||
```
|
||||
```yaml
|
||||
- type: filter.expr
|
||||
params:
|
||||
pattern: "Payload >= 0"
|
||||
|
||||
@@ -12,7 +12,7 @@ The `filter.regex` processor matches incoming string payload against a regular e
|
||||
|
||||
### Example
|
||||
Match strings starting with `hello`
|
||||
```
|
||||
```yaml
|
||||
- type: filter.regex
|
||||
params:
|
||||
pattern: "^hello.*"
|
||||
|
||||
@@ -12,7 +12,7 @@ The `float.parse` processor takes a string and parses it as a float with the spe
|
||||
|
||||
### Example
|
||||
This would parse the string payload as a 32 bit float and set the payload to that value.
|
||||
```
|
||||
```yaml
|
||||
- type: float.parse
|
||||
params:
|
||||
bitSize: 32
|
||||
|
||||
@@ -14,7 +14,7 @@ The `float.random` processor will set the payload to a random float between the
|
||||
|
||||
### Example
|
||||
This would generate a random 64-bit float between 1.1 and 1.5 and set the payload to that value.
|
||||
```
|
||||
```yaml
|
||||
- type: float.random
|
||||
params:
|
||||
bitSize: 64
|
||||
|
||||
@@ -21,7 +21,7 @@ This processor will create a new FreeD message with the specified parameters.
|
||||
|
||||
|
||||
### Example
|
||||
```
|
||||
```yaml
|
||||
- type: free.d.create
|
||||
params:
|
||||
id: "1"
|
||||
|
||||
@@ -10,6 +10,6 @@ This processor will decode incoming bytes into a FreeD message. This processor w
|
||||
- **type**: `free.d.decode`
|
||||
|
||||
### Example
|
||||
```
|
||||
```yaml
|
||||
- type: free.d.decode
|
||||
```
|
||||
@@ -10,6 +10,6 @@ This processor will encode a FreeD message into an array of bytes. This processo
|
||||
- **type**: `free.d.encode`
|
||||
|
||||
### Example
|
||||
```
|
||||
```yaml
|
||||
- type: free.d.encode
|
||||
```
|
||||
@@ -15,7 +15,7 @@ This process will make an HTTP request to the specified URL using the specified
|
||||
|
||||
### Example
|
||||
Make a GET request to `https://example.com`
|
||||
```
|
||||
```yaml
|
||||
- type: http.request.do
|
||||
params:
|
||||
method: GET
|
||||
|
||||
@@ -14,7 +14,7 @@ This processor will create a new HTTP response with the specified status code an
|
||||
|
||||
### Example
|
||||
This would create an HTTP response with a status code of `200` and a body of `OK`
|
||||
```
|
||||
```yaml
|
||||
- type: http.response.create
|
||||
params:
|
||||
status: 200
|
||||
|
||||
@@ -13,7 +13,7 @@ The `int.parse` processor takes a string and parses it as an integer with the sp
|
||||
|
||||
### Example
|
||||
This would parse the string payload as a 32 bit, base 10 integer and set the payload to that value.
|
||||
```
|
||||
```yaml
|
||||
- type: int.parse
|
||||
params:
|
||||
bitSize: 32
|
||||
|
||||
@@ -12,7 +12,7 @@ The `int.random` processor will set the payload to a random integer between the
|
||||
|
||||
### Example
|
||||
This would generate a random integer between -127 and 127 and set the payload to that value.
|
||||
```
|
||||
```yaml
|
||||
- type: int.random
|
||||
params:
|
||||
min: -127
|
||||
|
||||
@@ -16,7 +16,7 @@ This processor will scale an integer value from one range to another. This proce
|
||||
|
||||
### Example
|
||||
Scale an integer value from the range 0-255 to the range 0-100
|
||||
```
|
||||
```yaml
|
||||
- type: int.scale
|
||||
params:
|
||||
inMin: 0
|
||||
|
||||
@@ -8,6 +8,6 @@ Convert an incoming byte array or raw string into a JSON object. This processor
|
||||
- **type**: `json.decode`
|
||||
|
||||
### Example
|
||||
```
|
||||
```yaml
|
||||
- type: json.decode
|
||||
```
|
||||
@@ -11,6 +11,6 @@ This processor will encode an incoming object into a JSON byte array. This proce
|
||||
|
||||
|
||||
### Example
|
||||
```
|
||||
```yaml
|
||||
- type: json.encode
|
||||
```
|
||||
|
||||
@@ -13,7 +13,7 @@ The `kv.get` processor gets the value associated with a key from a compatible mo
|
||||
|
||||
### Example
|
||||
This will attempt to get the value for the `counter` key from the module with an id of `redis`
|
||||
```
|
||||
```yaml
|
||||
- type: kv.get
|
||||
params:
|
||||
module: redis
|
||||
|
||||
@@ -14,7 +14,7 @@ The `kv.set` processor sets the value associated with a key from a compatible mo
|
||||
|
||||
### Example
|
||||
This will attempt to set the key `hello` to `world` using the module with an id of `redis`
|
||||
```
|
||||
```yaml
|
||||
- type: kv.set
|
||||
params:
|
||||
module: redis
|
||||
|
||||
@@ -9,6 +9,6 @@ This processor will decode incoming bytes into a MIDI message. This processor wi
|
||||
- **type**: `midi.message.decode`
|
||||
|
||||
### Example
|
||||
```
|
||||
```yaml
|
||||
- type: midi.message.decode
|
||||
```
|
||||
|
||||
@@ -9,6 +9,6 @@ This processor will encode a MIDI message into an array of bytes. This processor
|
||||
- **type**: `midi.message.encode`
|
||||
|
||||
### Example
|
||||
```
|
||||
```yaml
|
||||
- type: midi.message.encode
|
||||
```
|
||||
@@ -9,6 +9,6 @@ This processor will unpack a MIDI message into its individual components. This p
|
||||
- **type**: `midi.message.unpack`
|
||||
|
||||
### Example
|
||||
```
|
||||
```yaml
|
||||
- type: midi.message.unpack
|
||||
```
|
||||
@@ -13,7 +13,7 @@ This processor will create an MQTT message from the provided parameters. This pr
|
||||
- **payload**: the payload of the message. This can be a string or a byte array.
|
||||
|
||||
### Example
|
||||
```
|
||||
```yaml
|
||||
- type: mqtt.message.create
|
||||
params:
|
||||
topic: "test/topic"
|
||||
|
||||
@@ -12,7 +12,7 @@ This processor will create a NATS message from the provided parameters. This pro
|
||||
- **payload**: the payload of the message.
|
||||
|
||||
### Example
|
||||
```
|
||||
```yaml
|
||||
- type: nats.message.create
|
||||
params:
|
||||
subject: "events"
|
||||
|
||||
@@ -15,7 +15,7 @@ This processor will create an OSC message from the provided parameters. This pro
|
||||
### Example
|
||||
Create an OSC message with the address `/test/message` and two integer arguments from the payload of the message being processed.
|
||||
|
||||
```
|
||||
```yaml
|
||||
- type: osc.message.create
|
||||
params:
|
||||
address: "/test/message"
|
||||
|
||||
@@ -9,6 +9,6 @@ The `osc.message.decode` processor takes a array of bytes and turn it into OSC m
|
||||
- **type**: `osc.message.decode`
|
||||
|
||||
### Example
|
||||
```
|
||||
```yaml
|
||||
- type: osc.message.encode
|
||||
```
|
||||
@@ -9,6 +9,6 @@ The `osc.message.encode` processor takes an OSC message and turns it into an arr
|
||||
- **type**: `osc.message.encode`
|
||||
|
||||
### Example
|
||||
```
|
||||
```yaml
|
||||
- type: osc.message.encode
|
||||
```
|
||||
@@ -13,7 +13,8 @@ The `router.output` processor takes any payload and outputs to the specified mod
|
||||
|
||||
### Example
|
||||
Output to the `osc-out` module.
|
||||
```
|
||||
|
||||
```yaml
|
||||
- type: router.output
|
||||
params:
|
||||
module: osc-out
|
||||
|
||||
@@ -11,7 +11,8 @@ The processor will execute the provided Expr expression and return the result as
|
||||
|
||||
### Example
|
||||
This example will add 1 to the wrapped payload.
|
||||
```
|
||||
|
||||
```yaml
|
||||
- type: script.expr
|
||||
params:
|
||||
expression: "Payload + 1"
|
||||
|
||||
@@ -16,7 +16,8 @@ This run your JavaScript program in a [sandboxed environment](https://gitlab.com
|
||||
- **program**: The JavaScript program to run. The payload is available as a global variable called `payload`.
|
||||
### Example
|
||||
Replace all occurrences of `|` with `,` in the payload
|
||||
```
|
||||
|
||||
```yaml
|
||||
- type: script.js
|
||||
params:
|
||||
program: |
|
||||
|
||||
@@ -14,7 +14,7 @@ This processor will load and execute a WASM plugin using the [Extism](https://ex
|
||||
|
||||
### Example
|
||||
This example will load the plugin at `./test.wasm` and execute the `test` function
|
||||
```
|
||||
```yaml
|
||||
- type: script.wasm
|
||||
params:
|
||||
path: "./test.wasm"
|
||||
|
||||
@@ -14,7 +14,7 @@ This processor will create a SIP response message with an audio file as the payl
|
||||
|
||||
### Example
|
||||
This example will create a SIP response that will wait 1 second then play `response.wav` then wait another second before completing the response.
|
||||
```
|
||||
```yaml
|
||||
- type: sip.response.audio.create
|
||||
params:
|
||||
preWait: 1000
|
||||
|
||||
@@ -14,7 +14,7 @@ This processor will create a SIP DTMF response from the provided parameters. If
|
||||
|
||||
### Example
|
||||
This example will create a SIP response that will wait 1 second then play the DTMF digits "1234" then wait another second before completing the response.
|
||||
```
|
||||
```yaml
|
||||
- type: sip.response.dtmf.create
|
||||
params:
|
||||
preWait: 1000
|
||||
|
||||
@@ -12,7 +12,7 @@ The `string.create` processor creates a string based on the provided template. T
|
||||
|
||||
### Example
|
||||
This would create a string using the `Address` property of the incoming message like and OSC message
|
||||
```
|
||||
```yaml
|
||||
- type: string.create
|
||||
params:
|
||||
template: "{{.Address}}
|
||||
|
||||
@@ -9,6 +9,6 @@ The `string.decode` processor takes a array of bytes and turn it into string. Th
|
||||
- **type**: `string.decode`
|
||||
|
||||
### Example
|
||||
```
|
||||
```yaml
|
||||
- type: string.decode
|
||||
```
|
||||
@@ -9,6 +9,6 @@ The `string.encode` processor takes a string and turns it into an array of bytes
|
||||
- **type**: `string.encode`
|
||||
|
||||
### Example
|
||||
```
|
||||
```yaml
|
||||
- type: string.encode
|
||||
```
|
||||
@@ -12,7 +12,8 @@ The `string.split` processor takes a string and turns it into an array of string
|
||||
|
||||
### Example
|
||||
Split incoming string on `,` i.e `"one,two,three"` -> `["one","two","three"]`
|
||||
```
|
||||
|
||||
```yaml
|
||||
- type: string.split
|
||||
params:
|
||||
separator: ","
|
||||
|
||||
@@ -12,7 +12,7 @@ The `time.sleep` processor will sleep for the specified `duration` in millisecon
|
||||
|
||||
### Example
|
||||
This would sleep for 5 seconds before passing the message to the next processor.
|
||||
```
|
||||
```yaml
|
||||
- type: time.sleep
|
||||
params:
|
||||
duration: 5000
|
||||
|
||||
Reference in New Issue
Block a user