diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 5acbdac..782a0ad 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -1,10 +1,10 @@
version: 2
updates:
- - package-ecosystem: 'npm'
- directory: '/'
+ - package-ecosystem: "npm"
+ directory: "/"
schedule:
- interval: 'weekly'
- - package-ecosystem: 'github-actions'
- directory: '/'
+ interval: "weekly"
+ - package-ecosystem: "github-actions"
+ directory: "/"
schedule:
- interval: 'weekly'
+ interval: "weekly"
diff --git a/.github/workflows/check-docs-build.yml b/.github/workflows/check-docs-build.yml
index 644ce2e..4cf86a0 100644
--- a/.github/workflows/check-docs-build.yml
+++ b/.github/workflows/check-docs-build.yml
@@ -13,9 +13,9 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
- node-version-file: '.nvmrc'
- cache: 'npm'
- cache-dependency-path: 'package-lock.json'
+ node-version-file: ".nvmrc"
+ cache: "npm"
+ cache-dependency-path: "package-lock.json"
- name: Install Node.js dependencies
run: npm ci
diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml
index 96bb72e..65b0d49 100644
--- a/.github/workflows/publish-docs.yml
+++ b/.github/workflows/publish-docs.yml
@@ -13,9 +13,9 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
- node-version-file: '.nvmrc'
- cache: 'npm'
- cache-dependency-path: 'package-lock.json'
+ node-version-file: ".nvmrc"
+ cache: "npm"
+ cache-dependency-path: "package-lock.json"
- name: Install Node.js dependencies
run: npm ci
diff --git a/astro.config.mjs b/astro.config.mjs
index c3b1906..b80532b 100644
--- a/astro.config.mjs
+++ b/astro.config.mjs
@@ -21,15 +21,15 @@ export default defineConfig({
sidebar: [
{
label: "showbridge",
- items:[{ autogenerate: { directory: "/showbridge" } }],
+ items: [{ autogenerate: { directory: "/showbridge" } }],
},
{
label: "Run",
- items:[{ autogenerate: { directory: "run" } }],
+ items: [{ autogenerate: { directory: "run" } }],
},
{
label: "Concepts",
- items:[{ autogenerate: { directory: "concepts" } }],
+ items: [{ autogenerate: { directory: "concepts" } }],
},
{
label: "Modules",
@@ -37,27 +37,27 @@ export default defineConfig({
{
label: "Database",
collapsed: true,
- items:[{ autogenerate: { directory: "modules/db" } }],
+ items: [{ autogenerate: { directory: "modules/db" } }],
},
{
label: "HTTP",
collapsed: true,
- items:[{ autogenerate: { directory: "modules/http" } }],
+ items: [{ autogenerate: { directory: "modules/http" } }],
},
{
label: "MIDI",
collapsed: true,
- items:[{ autogenerate: { directory: "modules/midi" } }],
+ items: [{ autogenerate: { directory: "modules/midi" } }],
},
{
label: "MQTT",
collapsed: true,
- items:[{ autogenerate: { directory: "modules/mqtt" } }],
+ items: [{ autogenerate: { directory: "modules/mqtt" } }],
},
{
label: "NATS",
collapsed: true,
- items:[{ autogenerate: { directory: "modules/nats" } }],
+ items: [{ autogenerate: { directory: "modules/nats" } }],
},
{
label: "Network",
@@ -66,34 +66,34 @@ export default defineConfig({
{
label: "TCP",
collapsed: true,
- items:[{ autogenerate: { directory: "modules/net/tcp" } }],
+ items: [{ autogenerate: { directory: "modules/net/tcp" } }],
},
{
label: "UDP",
collapsed: true,
- items:[{ autogenerate: { directory: "modules/net/udp" } }],
+ items: [{ autogenerate: { directory: "modules/net/udp" } }],
},
],
},
{
label: "PosiStageNet",
collapsed: true,
- items:[{ autogenerate: { directory: "modules/psn" } }],
+ items: [{ autogenerate: { directory: "modules/psn" } }],
},
{
label: "Redis",
collapsed: true,
- items:[{ autogenerate: { directory: "modules/redis" } }],
+ items: [{ autogenerate: { directory: "modules/redis" } }],
},
{
label: "Time",
collapsed: true,
- items:[{ autogenerate: { directory: "modules/time" } }],
+ items: [{ autogenerate: { directory: "modules/time" } }],
},
{
label: "Serial",
collapsed: true,
- items:[{ autogenerate: { directory: "modules/serial" } }],
+ items: [{ autogenerate: { directory: "modules/serial" } }],
},
{
label: "SIP",
@@ -102,19 +102,19 @@ export default defineConfig({
{
label: "Call",
collapsed: true,
- items:[{ autogenerate: { directory: "modules/sip/call" } }],
+ items: [{ autogenerate: { directory: "modules/sip/call" } }],
},
{
label: "DTMF",
collapsed: true,
- items:[{ autogenerate: { directory: "modules/sip/dtmf" } }],
+ items: [{ autogenerate: { directory: "modules/sip/dtmf" } }],
},
],
},
{
label: "WebSocket",
collapsed: true,
- items:[{ autogenerate: { directory: "modules/websocket" } }],
+ items: [{ autogenerate: { directory: "modules/websocket" } }],
},
],
},
@@ -124,32 +124,32 @@ export default defineConfig({
{
label: "ArtNet",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/artnet" } }],
+ items: [{ autogenerate: { directory: "processors/artnet" } }],
},
{
label: "Database",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/db" } }],
+ items: [{ autogenerate: { directory: "processors/db" } }],
},
{
label: "Debug",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/debug" } }],
+ items: [{ autogenerate: { directory: "processors/debug" } }],
},
{
label: "Filter",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/filter" } }],
+ items: [{ autogenerate: { directory: "processors/filter" } }],
},
{
label: "Float",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/float" } }],
+ items: [{ autogenerate: { directory: "processors/float" } }],
},
{
label: "FreeD",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/free-d" } }],
+ items: [{ autogenerate: { directory: "processors/free-d" } }],
},
{
label: "HTTP",
@@ -158,29 +158,33 @@ export default defineConfig({
{
label: "Request",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/http/request" } }],
+ items: [
+ { autogenerate: { directory: "processors/http/request" } },
+ ],
},
{
label: "Response",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/http/response" } }],
+ items: [
+ { autogenerate: { directory: "processors/http/response" } },
+ ],
},
],
},
{
label: "Int",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/int" } }],
+ items: [{ autogenerate: { directory: "processors/int" } }],
},
{
label: "JSON",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/json" } }],
+ items: [{ autogenerate: { directory: "processors/json" } }],
},
{
label: "Key/Value",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/kv" } }],
+ items: [{ autogenerate: { directory: "processors/kv" } }],
},
{
label: "MIDI",
@@ -189,27 +193,45 @@ export default defineConfig({
{
label: "Message",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/midi/message" } }],
+ items: [
+ { autogenerate: { directory: "processors/midi/message" } },
+ ],
},
{
label: "Note On",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/midi/note_on" } }],
+ items: [
+ { autogenerate: { directory: "processors/midi/note_on" } },
+ ],
},
{
label: "Note Off",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/midi/note_off" } }],
+ items: [
+ { autogenerate: { directory: "processors/midi/note_off" } },
+ ],
},
{
label: "Control Change",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/midi/control_change" } }],
+ items: [
+ {
+ autogenerate: {
+ directory: "processors/midi/control_change",
+ },
+ },
+ ],
},
{
label: "Program Change",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/midi/program_change" } }],
+ items: [
+ {
+ autogenerate: {
+ directory: "processors/midi/program_change",
+ },
+ },
+ ],
},
],
},
@@ -220,7 +242,9 @@ export default defineConfig({
{
label: "Message",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/mqtt/message" } }],
+ items: [
+ { autogenerate: { directory: "processors/mqtt/message" } },
+ ],
},
],
},
@@ -231,7 +255,9 @@ export default defineConfig({
{
label: "Message",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/nats/message" } }],
+ items: [
+ { autogenerate: { directory: "processors/nats/message" } },
+ ],
},
],
},
@@ -242,19 +268,21 @@ export default defineConfig({
{
label: "Message",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/osc/message" } }],
+ items: [
+ { autogenerate: { directory: "processors/osc/message" } },
+ ],
},
],
},
{
label: "Router",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/router" } }],
+ items: [{ autogenerate: { directory: "processors/router" } }],
},
{
label: "Script",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/script" } }],
+ items: [{ autogenerate: { directory: "processors/script" } }],
},
{
label: "SIP",
@@ -267,12 +295,24 @@ export default defineConfig({
{
label: "Audio",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/sip/response/audio" } }],
+ items: [
+ {
+ autogenerate: {
+ directory: "processors/sip/response/audio",
+ },
+ },
+ ],
},
{
label: "DTMF",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/sip/response/dtmf" } }],
+ items: [
+ {
+ autogenerate: {
+ directory: "processors/sip/response/dtmf",
+ },
+ },
+ ],
},
],
},
@@ -281,18 +321,18 @@ export default defineConfig({
{
label: "String",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/string" } }],
+ items: [{ autogenerate: { directory: "processors/string" } }],
},
{
label: "Time",
collapsed: true,
- items:[{ autogenerate: { directory: "processors/time" } }],
+ items: [{ autogenerate: { directory: "processors/time" } }],
},
],
},
{
label: "Examples",
- items:[{ autogenerate: { directory: "examples" } }],
+ items: [{ autogenerate: { directory: "examples" } }],
},
],
}),
diff --git a/src/content.config.ts b/src/content.config.ts
index 6a7b7a0..7fbcf2c 100644
--- a/src/content.config.ts
+++ b/src/content.config.ts
@@ -1,6 +1,6 @@
-import { defineCollection } from 'astro:content';
-import { docsLoader } from '@astrojs/starlight/loaders';
-import { docsSchema } from '@astrojs/starlight/schema';
+import { defineCollection } from "astro:content";
+import { docsLoader } from "@astrojs/starlight/loaders";
+import { docsSchema } from "@astrojs/starlight/schema";
export const collections = {
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
diff --git a/src/content/docs/concepts/config.mdx b/src/content/docs/concepts/config.mdx
index 95a141d..859b904 100644
--- a/src/content/docs/concepts/config.mdx
+++ b/src/content/docs/concepts/config.mdx
@@ -1,9 +1,11 @@
---
title: Config
sidebar:
- order: 1
+ order: 1
---
-The showbridge router's config is entirely controlled by a YAML/JSON config file. This file must be made by hand for now. I do provide some starter/example configs to look at to get a general idea of what one entails.
+
+The showbridge router's config is entirely controlled by a YAML/JSON config file. This file must be made by hand for now. I do provide some starter/example configs to look at to get a general idea of what one entails.
Resources
-- good idea to start with [config.yaml](https://github.com/jwetzell/showbridge-go/blob/main/config.yaml)
\ No newline at end of file
+
+- good idea to start with [config.yaml](https://github.com/jwetzell/showbridge-go/blob/main/config.yaml)
diff --git a/src/content/docs/concepts/modules.mdx b/src/content/docs/concepts/modules.mdx
index 989c39c..615a2ad 100644
--- a/src/content/docs/concepts/modules.mdx
+++ b/src/content/docs/concepts/modules.mdx
@@ -1,12 +1,13 @@
---
title: Modules
sidebar:
- order: 2
+ order: 2
---
Modules are anything that can produce input and/or handle output. They are configured in the `modules` property of the [router config file](/concepts/config).
## YAML Definition
+
A module YAML block has the following properties
- **id**: user assigned unique identifier that will be used to reference a module instance in a [route](/concepts/routes)
diff --git a/src/content/docs/concepts/payload.mdx b/src/content/docs/concepts/payload.mdx
index 877c1e2..1f52e62 100644
--- a/src/content/docs/concepts/payload.mdx
+++ b/src/content/docs/concepts/payload.mdx
@@ -1,10 +1,11 @@
---
title: Payload
sidebar:
- order: 5
+ order: 5
---
[Processors](/concepts/Processors) operator on a "wrapped" version of the message produces by the module. This wrapped version is available to all processors and is defined as follows:
+
- **Payload**: the actual message produced by the module (or the result of the previous [processor](/concepts/processors) in the [route](/concepts/routes)).
- **Source**: the id of the module that produced the original payload.
- **Sender**: the network address of the module that produced the message (if applicable not all modules will have a sender address).
diff --git a/src/content/docs/concepts/processors.mdx b/src/content/docs/concepts/processors.mdx
index e3a5f65..63687a4 100644
--- a/src/content/docs/concepts/processors.mdx
+++ b/src/content/docs/concepts/processors.mdx
@@ -1,12 +1,13 @@
---
title: Processors
sidebar:
- order: 4
+ order: 4
---
Processors are anything that create or manipulate messages. They are configured in the `processors` property of an individual [route](/concepts/routes). Processors have the ability to change the type of the message flowing through the system so a byte array can come into a `osc.message.decode` processor and a OSC message type will come out of the processor.
## YAML Definition
+
A processor YAML block has the following properties
- **type**: the processor type
diff --git a/src/content/docs/concepts/routes.mdx b/src/content/docs/concepts/routes.mdx
index 2874494..5f719cf 100644
--- a/src/content/docs/concepts/routes.mdx
+++ b/src/content/docs/concepts/routes.mdx
@@ -1,12 +1,13 @@
---
title: Routes
sidebar:
- order: 3
+ order: 3
---
-Routes take the messages coming from a module and push them through a list of [processors](/concepts/processors). Having no processors is valid but serves no real purpose and is basically a no-op.
+Routes take the messages coming from a module and push them through a list of [processors](/concepts/processors). Having no processors is valid but serves no real purpose and is basically a no-op.
## YAML Definition
+
- **input**: the id of the [module](/concepts/modules) that will provide messages to this route
- **processors**: (optional) array of [processors](/concepts/processors) that will be called in order and the result of the previous will be fed to the next processor.
- - an error in a processor step will result in the individual route being terminated
\ No newline at end of file
+ - an error in a processor step will result in the individual route being terminated
diff --git a/src/content/docs/examples/dial-a-cue.mdx b/src/content/docs/examples/dial-a-cue.mdx
index 7be6f92..9c05217 100644
--- a/src/content/docs/examples/dial-a-cue.mdx
+++ b/src/content/docs/examples/dial-a-cue.mdx
@@ -1,10 +1,10 @@
---
title: SIP > OSC
sidebar:
- order: 2
+ order: 2
---
-import { Code } from '@astrojs/starlight/components';
+import { Code } from "@astrojs/starlight/components";
This config starts an SIP server listening on port `5060`. Any incoming call will result in a OSC message being sent to `127.0.0.1:53000` with the address set to [fire a QLab cue](https://qlab.app/docs/v5/scripting/osc-dictionary-v5/#/cue/{cue_number}/go) with the dialed number as the cue number. This was tested with a cheap SIP gateway like [this one](https://www.grandstream.com/products/gateways-and-atas/analog-telephone-adaptors/product/ht802).
@@ -32,6 +32,6 @@ routes:
- type: router.output
params:
module: udp
-`
+`;
-
+
diff --git a/src/content/docs/examples/http-to-osc.mdx b/src/content/docs/examples/http-to-osc.mdx
index 3df0978..018c441 100644
--- a/src/content/docs/examples/http-to-osc.mdx
+++ b/src/content/docs/examples/http-to-osc.mdx
@@ -1,14 +1,13 @@
---
title: HTTP > OSC
sidebar:
- order: 1
+ order: 1
---
-import { Code } from '@astrojs/starlight/components';
+import { Code } from "@astrojs/starlight/components";
This config starts an HTTP server listening on port `3000`. Any HTTP request coming into that server will result in a OSC message being sent to `127.0.0.1:8000` with the address set to the path from the incoming HTTP message.
-
export const example = `
api:
enabled: true
@@ -33,6 +32,6 @@ routes:
- type: router.output # output to the udp module
params:
module: udp
-`
+`;
-
+
diff --git a/src/content/docs/index.mdx b/src/content/docs/index.mdx
index 1d6cb15..58383a4 100644
--- a/src/content/docs/index.mdx
+++ b/src/content/docs/index.mdx
@@ -4,8 +4,8 @@ sidebar:
order: 1
---
-Welcome to the showbridge docs, this is an ever changing store of information related to [showbridge](https://github.com/jwetzell/showbridge-go).
+Welcome to the showbridge docs, this is an ever changing store of information related to [showbridge](https://github.com/jwetzell/showbridge-go).
-If you find something that doesn't make sense or needs more documentation/clarification please open an issue on the [docs repo](https://github.com/jwetzell/showbridge-docs/issues).
+If you find something that doesn't make sense or needs more documentation/clarification please open an issue on the [docs repo](https://github.com/jwetzell/showbridge-docs/issues).
For issues related to the actual application please open them on the [showbridge repo](https://github.com/jwetzell/showbridge-go)
diff --git a/src/content/docs/modules/db/sqlite.mdx b/src/content/docs/modules/db/sqlite.mdx
index c3da0ba..5ee307c 100644
--- a/src/content/docs/modules/db/sqlite.mdx
+++ b/src/content/docs/modules/db/sqlite.mdx
@@ -1,21 +1,24 @@
---
title: SQLite
sidebar:
- order: 1
+ order: 1
---
-The `db.sqlite` module can open/create SQLite databases
+
+The `db.sqlite` module can open/create SQLite databases
- **type**: `db.sqlite`
- **params**:
- - **dsn**: the data source name, this can be a file path or the special `:memory:` name for an in-memory DB
+ - **dsn**: the data source name, this can be a file path or the special `:memory:` name for an in-memory DB
## Cap
### Example snippet
+
Opens an in-memory SQLite database
+
```yaml
- id: db
type: db.sqlite
params:
dsn: ":memory:"
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/modules/http/http-server.mdx b/src/content/docs/modules/http/http-server.mdx
index f357ec9..a853958 100644
--- a/src/content/docs/modules/http/http-server.mdx
+++ b/src/content/docs/modules/http/http-server.mdx
@@ -1,20 +1,23 @@
---
title: HTTP Server
sidebar:
- label: Server
- order: 2
+ label: Server
+ order: 2
---
+
The `http.server` module emits a message for every HTTP request that is made to the server.
- **type**: `http.server`
- **params**:
- - **port**: TCP port to listen for HTTP requests on
+ - **port**: TCP port to listen for HTTP requests on
### Example
+
Start an HTTP server listening on port 3000
+
```yaml
- id: httpServer
type: http.server
params:
port: 3000
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/modules/midi/input.mdx b/src/content/docs/modules/midi/input.mdx
index 8b972ba..6d33caf 100644
--- a/src/content/docs/modules/midi/input.mdx
+++ b/src/content/docs/modules/midi/input.mdx
@@ -1,27 +1,30 @@
---
title: MIDI Input
sidebar:
- label: Input
- order: 1
+ label: Input
+ order: 1
---
-import { Aside } from '@astrojs/starlight/components';
+import { Aside } from "@astrojs/starlight/components";
The `midi.input` module connects to a midi device (or virtual device) and emits MIDI messages that come in on that port. This module does not support output.
- **type**: `midi.input`
- **params**:
- - **port**: name of the MIDI port to connect to
+ - **port**: name of the MIDI port to connect to
### Example
+
Open a MIDI connection to `Logic Pro Virtual Out`.
+
```yaml
- id: midiInput
type: midi.input
params:
port: "Logic Pro Virtual Out"
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/modules/midi/output.mdx b/src/content/docs/modules/midi/output.mdx
index 394ee82..49a37d0 100644
--- a/src/content/docs/modules/midi/output.mdx
+++ b/src/content/docs/modules/midi/output.mdx
@@ -1,26 +1,30 @@
---
title: MIDI Output
sidebar:
- label: Output
- order: 2
+ label: Output
+ order: 2
---
-import { Aside } from '@astrojs/starlight/components';
+
+import { Aside } from "@astrojs/starlight/components";
The `midi.output` module connects to a midi device (or virtual device) and allows sending MIDI messages out to that device. This module does not produce any messages and so using it as an `input` to a [route](/concepts/routes) would be pointless.
- **type**: `midi.output`
- **params**:
- - **port**: name of the MIDI port to connect to
+ - **port**: name of the MIDI port to connect to
### Example
+
Open a MIDI connection to `Logic Pro Virtual In`.
+
```yaml
- id: midiOutput
type: midi.output
params:
port: "Logic Pro Virtual In"
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/modules/mqtt/client.mdx b/src/content/docs/modules/mqtt/client.mdx
index 2f434fa..176f8a6 100644
--- a/src/content/docs/modules/mqtt/client.mdx
+++ b/src/content/docs/modules/mqtt/client.mdx
@@ -1,20 +1,22 @@
---
title: MQTT Client
sidebar:
- label: Client
- order: 1
+ label: Client
+ order: 1
---
The `mqtt.client` module connects to a MQTT broker and emits a message messages based on the subscribed topic it receives from the port. This module is also capable of publishing MQTT messages to the connected broker.
- **type**: `mqtt.client`
- **params**:
- - **broker**: connection string for the mqtt broker (`mqtt://test.mosquitto.org:1833`)
- - **topic** mqtt topic to subscribe to
- - **clientId** client ID for this connection to the broker
+ - **broker**: connection string for the mqtt broker (`mqtt://test.mosquitto.org:1833`)
+ - **topic** mqtt topic to subscribe to
+ - **clientId** client ID for this connection to the broker
### Example
+
Open a mqtt connection to `test.mosquitto.org` subscribing to the `showbridge` topic.
+
```yaml
- id: mqttClient
type: mqtt.client
@@ -22,4 +24,4 @@ Open a mqtt connection to `test.mosquitto.org` subscribing to the `showbridge` t
broker: "mqtt://test.mosquitto.org:1833"
topic: showbridge
clientId: showbridge
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/modules/nats/client.mdx b/src/content/docs/modules/nats/client.mdx
index 8e7ee23..4647c97 100644
--- a/src/content/docs/modules/nats/client.mdx
+++ b/src/content/docs/modules/nats/client.mdx
@@ -1,21 +1,25 @@
---
title: NATS Client
sidebar:
- label: Client
- order: 1
+ label: Client
+ order: 1
---
+
This module connects to a [NATS](https://nats.io/) server and subscribes to a subject.
+
- **type**: `nats.client`
- **params**:
- - **url**: the URL of the NATS server to connect to (e.g. `nats://localhost:4222`)
- - **subject**: the subject to subscribe to
+ - **url**: the URL of the NATS server to connect to (e.g. `nats://localhost:4222`)
+ - **subject**: the subject to subscribe to
### Example
-Connect to a local NATS server and subscribe to the `events` subject
+
+Connect to a local NATS server and subscribe to the `events` subject
+
```yaml
- id: natsClient
type: nats.client
params:
url: nats://localhost:4222
subject: events
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/modules/nats/server.mdx b/src/content/docs/modules/nats/server.mdx
index e17e50c..ab76b7e 100644
--- a/src/content/docs/modules/nats/server.mdx
+++ b/src/content/docs/modules/nats/server.mdx
@@ -1,21 +1,25 @@
---
title: NATS Server
sidebar:
- label: Server
- order: 2
+ label: Server
+ order: 2
---
+
This module starts a NATS server that listens for incoming connections.
+
- **type**: `nats.server`
- **params**:
- - **ip**: (optional) the IP address to bind the server to defaults to `0.0.0.0`
- - **port**: (optional) the port to listen on defaults to `4222`
+ - **ip**: (optional) the IP address to bind the server to defaults to `0.0.0.0`
+ - **port**: (optional) the port to listen on defaults to `4222`
### Example
+
Start a local NATS server listening on port 5555
+
```yaml
- id: httpServer
type: http.server
params:
ip: 127.0.0.1
port: 5555
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/modules/net/tcp/client.mdx b/src/content/docs/modules/net/tcp/client.mdx
index 3b37a0a..aef190d 100644
--- a/src/content/docs/modules/net/tcp/client.mdx
+++ b/src/content/docs/modules/net/tcp/client.mdx
@@ -1,25 +1,27 @@
---
title: TCP Client
sidebar:
- label: Client
- order: 1
+ label: Client
+ order: 1
---
+
The `net.tcp.client` module connects to TCP server and emits messages based on the data it receives from the server that it connects to. Messages are determined by "framing" techniques as TCP is a stream based protocol. The module will attempt to reconnect anytime the connection is closed.
- **type**: `net.tcp.client`
- **params**:
- - **host**: IP or FQDN to connect to
- - **port**: TCP port to connect to
- - **framing**: how to chunk the TCP stream into "messages"
- - LF `\n`
- - CR `\r`
- - CRLF `\r\n`
- - [SLIP](https://en.wikipedia.org/wiki/Serial_Line_Internet_Protocol)
- - RAW (no framing is done bytes are sent out as they are received)
-
+ - **host**: IP or FQDN to connect to
+ - **port**: TCP port to connect to
+ - **framing**: how to chunk the TCP stream into "messages"
+ - LF `\n`
+ - CR `\r`
+ - CRLF `\r\n`
+ - [SLIP](https://en.wikipedia.org/wiki/Serial_Line_Internet_Protocol)
+ - RAW (no framing is done bytes are sent out as they are received)
### 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
@@ -27,4 +29,4 @@ Open a TCP connection to `127.0.0.1` port 8888, any incoming data will be split
host: 127.0.0.1
port: 8888
framing: LF
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/modules/net/tcp/server.mdx b/src/content/docs/modules/net/tcp/server.mdx
index ee0a6e8..2c89427 100644
--- a/src/content/docs/modules/net/tcp/server.mdx
+++ b/src/content/docs/modules/net/tcp/server.mdx
@@ -1,25 +1,27 @@
---
title: TCP Server
sidebar:
- label: Server
- order: 2
+ label: Server
+ order: 2
---
+
The `net.tcp.server` module emits a message messages based on the data it receives from clients that connect to it. Messages are determined by "framing" techniques as TCP is a stream based protocol.
- **type**: `net.tcp.server`
- **params**:
- - **ip**: (optional) IP address to bind the TCP server to, if left out it will listen on all interfaces
- - **port**: TCP port to listen on
- - **framing**: how to chunk of the incoming TCP stream into "messages"
- - LF `\n`
- - CR `\r`
- - CRLF `\r\n`
- - [SLIP](https://en.wikipedia.org/wiki/Serial_Line_Internet_Protocol)
- - RAW (no framing is done bytes are sent out as they are received)
-
+ - **ip**: (optional) IP address to bind the TCP server to, if left out it will listen on all interfaces
+ - **port**: TCP port to listen on
+ - **framing**: how to chunk of the incoming TCP stream into "messages"
+ - LF `\n`
+ - CR `\r`
+ - CRLF `\r\n`
+ - [SLIP](https://en.wikipedia.org/wiki/Serial_Line_Internet_Protocol)
+ - RAW (no framing is done bytes are sent out as they are received)
### 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
@@ -27,4 +29,4 @@ Start a TCP server listening on port 8888, incoming data will be split on line-f
ip: 127.0.0.1
port: 8888
framing: LF
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/modules/net/udp/client.mdx b/src/content/docs/modules/net/udp/client.mdx
index 2b27f1f..7a0b5b6 100644
--- a/src/content/docs/modules/net/udp/client.mdx
+++ b/src/content/docs/modules/net/udp/client.mdx
@@ -1,22 +1,25 @@
---
title: UDP Client
sidebar:
- label: Client
- order: 1
+ label: Client
+ order: 1
---
+
The `net.udp.client` module sends messages to a the configured `host` and `port`. This module does not produce any messages and so using it as an `input` to a [route](/concepts/routes) would be pointless.
- **type**: `net.udp.client`
- **params**:
- - **host**: IP or FQDN to send message to
- - **port**: UDP port to send messages to
+ - **host**: IP or FQDN to send message to
+ - **port**: UDP port to send messages to
### 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:
host: 127.0.0.1
port: 8888
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/modules/net/udp/multicast.mdx b/src/content/docs/modules/net/udp/multicast.mdx
index 1bf1481..d738ffc 100644
--- a/src/content/docs/modules/net/udp/multicast.mdx
+++ b/src/content/docs/modules/net/udp/multicast.mdx
@@ -1,21 +1,23 @@
---
title: UDP Multicast
sidebar:
- label: Multicast
- order: 3
+ label: Multicast
+ order: 3
---
- **type**: `net.udp.multicast`
- **params**:
- - **ip**: the multicast IP address to listen to
- - **port**: the port to listen on
+ - **ip**: the multicast IP address to listen to
+ - **port**: the port to listen on
### Example
+
Listen to the mDNS multicast address on port 5353
+
```yaml
- id: mdnsListener
type: net.udp.multicast
params:
ip: 224.0.0.251
port: 5353
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/modules/net/udp/server.mdx b/src/content/docs/modules/net/udp/server.mdx
index 8283155..ebd166d 100644
--- a/src/content/docs/modules/net/udp/server.mdx
+++ b/src/content/docs/modules/net/udp/server.mdx
@@ -1,23 +1,26 @@
---
title: UDP Server
sidebar:
- label: Server
- order: 2
+ label: Server
+ order: 2
---
+
The `net.udp.server` module emits a message for every incoming UDP datagram.
- **type**: `net.udp.server`
- **params**:
- - **ip**: (optional) IP address to bind the UDP server to, if left out it will listen on all interfaces
- - **port**: UDP port to listen on
- - **bufferSize**: (optional) Size of the read buffer for incoming UDP datagrams, defaults to `2048`
+ - **ip**: (optional) IP address to bind the UDP server to, if left out it will listen on all interfaces
+ - **port**: UDP port to listen on
+ - **bufferSize**: (optional) Size of the read buffer for incoming UDP datagrams, defaults to `2048`
### Example
+
Start a UDP server listening on port 8888 and only on `127.0.0.1`
+
```yaml
- id: udpServer
type: net.udp.server
params:
ip: 127.0.0.1
port: 8888
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/modules/psn/client.mdx b/src/content/docs/modules/psn/client.mdx
index dd0f03c..519bf6f 100644
--- a/src/content/docs/modules/psn/client.mdx
+++ b/src/content/docs/modules/psn/client.mdx
@@ -1,8 +1,8 @@
---
title: PSN Client
sidebar:
- label: Client
- order: 1
+ label: Client
+ order: 1
---
- **type**: `psn.client`
@@ -10,7 +10,8 @@ sidebar:
This module listens on the [PosiStageNet](http://posistage.net/) multicast address and emits tracker states anytime a new PSN message is received.
### Example
+
```yaml
- id: psnClient
type: psn.client
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/modules/redis/client.mdx b/src/content/docs/modules/redis/client.mdx
index df3763e..d77e0b2 100644
--- a/src/content/docs/modules/redis/client.mdx
+++ b/src/content/docs/modules/redis/client.mdx
@@ -1,23 +1,25 @@
---
title: Redis Client
sidebar:
- label: Client
- order: 1
+ label: Client
+ order: 1
---
The `redis.client` module connects to a Redis server. This module does not produce any messages and so using it as an `input` to a [route](/concepts/routes) would be pointless.
- **type**: `redis.client`
- **params**:
- - **host**: the Redis server host
- - **port**: the Redis server port
+ - **host**: the Redis server host
+ - **port**: the Redis server port
### Example
+
Connect to a Redis server running on `localhost` at port `6379`.
+
```yaml
- id: redisClient
type: redis.client
params:
host: "localhost"
port: 6379
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/modules/serial/client.mdx b/src/content/docs/modules/serial/client.mdx
index 70e5207..af7dff0 100644
--- a/src/content/docs/modules/serial/client.mdx
+++ b/src/content/docs/modules/serial/client.mdx
@@ -1,31 +1,34 @@
---
title: Serial Client
sidebar:
- label: Client
- order: 1
+ label: Client
+ order: 1
---
-import { Aside } from '@astrojs/starlight/components';
+import { Aside } from "@astrojs/starlight/components";
The `serial.client` module connects to a serial device and emits a message messages based on the data it receives from the port. Messages are determined by "framing" techniques as serial is a stream based protocol.
- **type**: `serial.client`
- **params**:
- - **port**: serial port to connect to i.e `/dev/ttyS0`
- - **baudRate** baud rate to use when connecting to serial port
- - **framing**: how to chunk the serial stream into "messages"
- - LF `\n`
- - CR `\r`
- - CRLF `\r\n`
- - [SLIP](https://en.wikipedia.org/wiki/Serial_Line_Internet_Protocol)
- - RAW (no framing is done bytes are sent out as they are received)
+ - **port**: serial port to connect to i.e `/dev/ttyS0`
+ - **baudRate** baud rate to use when connecting to serial port
+ - **framing**: how to chunk the serial stream into "messages"
+ - LF `\n`
+ - CR `\r`
+ - CRLF `\r\n`
+ - [SLIP](https://en.wikipedia.org/wiki/Serial_Line_Internet_Protocol)
+ - RAW (no framing is done bytes are sent out as they are received)
### 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
@@ -33,4 +36,4 @@ Open a serial connection to `/dev/ttyS0` with a buad rate of `115200`, any incom
port: "/dev/ttyS0"
baudRate: 115200
framing: LF
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/modules/sip/call/server.mdx b/src/content/docs/modules/sip/call/server.mdx
index 6aafd34..d95f77f 100644
--- a/src/content/docs/modules/sip/call/server.mdx
+++ b/src/content/docs/modules/sip/call/server.mdx
@@ -1,19 +1,23 @@
---
title: SIP Call Server
sidebar:
- label: Server
- order: 1
+ label: Server
+ order: 1
---
-This module starts a [SIP](https://en.wikipedia.org/wiki/Session_Initiation_Protocol) server that listens for incoming connections and emits call events when a new call is received. This can be used with cheap SIP gateway devices to connect an analog phone line and do interesting things like [firing QLab cues with phone calls](/examples/dial-a-cue).
+
+This module starts a [SIP](https://en.wikipedia.org/wiki/Session_Initiation_Protocol) server that listens for incoming connections and emits call events when a new call is received. This can be used with cheap SIP gateway devices to connect an analog phone line and do interesting things like [firing QLab cues with phone calls](/examples/dial-a-cue).
+
- **type**: `sip.call.server`
- **params**:
- - **ip**: (optional) the IP address to bind the server to defaults to `0.0.0.0`
- - **port**: (optional) the port to listen on defaults to `5060`
- - **transport**: (optional) the transport protocol to use (e.g. `udp`, `tcp`, `ws`) defaults to `udp`
- - **userAgent**: (optional) the User-Agent string to use in SIP responses defaults to `showbridge`
+ - **ip**: (optional) the IP address to bind the server to defaults to `0.0.0.0`
+ - **port**: (optional) the port to listen on defaults to `5060`
+ - **transport**: (optional) the transport protocol to use (e.g. `udp`, `tcp`, `ws`) defaults to `udp`
+ - **userAgent**: (optional) the User-Agent string to use in SIP responses defaults to `showbridge`
### Example
+
Start a UDP SIP server listening on port 5060
+
```yaml
- id: sipCallServer
type: sip.call.server
@@ -21,4 +25,4 @@ Start a UDP SIP server listening on port 5060
ip: 127.0.0.1
port: 5060
transport: udp
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/modules/sip/dtmf/server.mdx b/src/content/docs/modules/sip/dtmf/server.mdx
index 03870af..7dbad7a 100644
--- a/src/content/docs/modules/sip/dtmf/server.mdx
+++ b/src/content/docs/modules/sip/dtmf/server.mdx
@@ -1,21 +1,24 @@
---
title: SIP DTMF Server
sidebar:
- label: Server
- order: 1
+ label: Server
+ order: 1
---
+
This module starts a [SIP](https://en.wikipedia.org/wiki/Session_Initiation_Protocol) server that listens for incoming connections. When a call is received this module will emit events based on the touch tones (DTMF) received during the call. The event is sent out whenever the use presses the separator key defined in the params.
- **type**: `sip.dtmf.server`
- **params**:
- - **ip**: (optional) the IP address to bind the server to defaults to `0.0.0.0`
- - **port**: (optional) the port to listen on defaults to `5060`
- - **transport**: (optional) the transport protocol to use (e.g. `udp`, `tcp`, `ws`) defaults to `udp`
- - **userAgent**: (optional) the User-Agent string to use in SIP responses defaults to `showbridge`
- - **separator**: the DTMF separator key to know when to emit events
+ - **ip**: (optional) the IP address to bind the server to defaults to `0.0.0.0`
+ - **port**: (optional) the port to listen on defaults to `5060`
+ - **transport**: (optional) the transport protocol to use (e.g. `udp`, `tcp`, `ws`) defaults to `udp`
+ - **userAgent**: (optional) the User-Agent string to use in SIP responses defaults to `showbridge`
+ - **separator**: the DTMF separator key to know when to emit events
### 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
@@ -23,5 +26,5 @@ Start a UDP SIP server listening on port 5060 that will emit events whenever the
ip: 127.0.0.1
port: 5060
transport: udp
- separator: '#'
-```
\ No newline at end of file
+ separator: "#"
+```
diff --git a/src/content/docs/modules/time/interval.mdx b/src/content/docs/modules/time/interval.mdx
index 2daec4a..4fbe596 100644
--- a/src/content/docs/modules/time/interval.mdx
+++ b/src/content/docs/modules/time/interval.mdx
@@ -1,19 +1,22 @@
---
title: Interval
sidebar:
- order: 2
+ order: 2
---
+
The `time.interval` module emits a message at a specified duration. Sending any message to this module will reset the interval timer.
- **type**: `time.interval`
- **params**:
- - **duration**: time in milliseconds between messsages
+ - **duration**: time in milliseconds between messsages
### Example snippet
+
Emits a message every 3 seconds
+
```yaml
- id: every3Secs
type: time.interval
params:
duration: 3000
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/modules/time/timer.mdx b/src/content/docs/modules/time/timer.mdx
index 9987406..83f58e9 100644
--- a/src/content/docs/modules/time/timer.mdx
+++ b/src/content/docs/modules/time/timer.mdx
@@ -1,19 +1,22 @@
---
title: Timer
sidebar:
- order: 1
+ order: 1
---
+
The `time.timer` module emits only one message after a specified duration. Sending any message to this module will reset the timer.
- **type**: `time.timer`
- **params**:
- - **duration**: time in milliseconds to wait before emitting message
+ - **duration**: time in milliseconds to wait before emitting message
### Example snippet
+
Emits a message 5 seconds after the module is initialized
+
```yaml
- id: 5secs
type: time.timer
params:
duration: 5000
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/modules/websocket/client.mdx b/src/content/docs/modules/websocket/client.mdx
index fb42d4f..561e0cc 100644
--- a/src/content/docs/modules/websocket/client.mdx
+++ b/src/content/docs/modules/websocket/client.mdx
@@ -1,21 +1,23 @@
---
title: WebSocket Client
sidebar:
- label: Client
- order: 1
+ label: Client
+ order: 1
---
The `websocket.client` module opens a websocket connection to the specified URL. This module supports both text and binary websocket messages.
- **type**: `websocket.client`
- **params**:
- - **url**: the full url to connect to (`wss://echo.websocket.org`)
+ - **url**: the full url to connect to (`wss://echo.websocket.org`)
### Example
+
Connect to the example WS server at `echo.websocket.org`.
+
```yaml
- id: websocket
type: websocket.client
params:
url: "wss://echo.websocket.org"
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/artnet/decode.mdx b/src/content/docs/processors/artnet/decode.mdx
index c4be5d9..a387e9a 100644
--- a/src/content/docs/processors/artnet/decode.mdx
+++ b/src/content/docs/processors/artnet/decode.mdx
@@ -1,8 +1,8 @@
---
title: Decode ArtNet Packet
sidebar:
- label: Decode
- order: 1
+ label: Decode
+ order: 1
---
- **type**: `artnet.packet.decode`
@@ -10,6 +10,7 @@ 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
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/artnet/encode.mdx b/src/content/docs/processors/artnet/encode.mdx
index ee985aa..f2bd4ff 100644
--- a/src/content/docs/processors/artnet/encode.mdx
+++ b/src/content/docs/processors/artnet/encode.mdx
@@ -1,14 +1,15 @@
---
title: Encode ArtNet Packet
sidebar:
- label: Encode
- order: 2
+ label: Encode
+ order: 2
---
- **type**: `artnet.packet.encode`
-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.
+ 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
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/db/query.mdx b/src/content/docs/processors/db/query.mdx
index f646ee3..124a511 100644
--- a/src/content/docs/processors/db/query.mdx
+++ b/src/content/docs/processors/db/query.mdx
@@ -1,20 +1,24 @@
---
title: Database Query
sidebar:
- label: Query
- order: 1
+ label: Query
+ order: 1
---
+
The `db.query` processor will issue a query to the specified module and return the result to the next processor in line.
- **type**: `db.query`
- **params**:
- - **module**: the id of the [module](/concepts/modules) to issue query to.
- - **query**: the query to execute.
+ - **module**: the id of the [module](/concepts/modules) to issue query to.
+ - **query**: the query to execute.
+
### Example
+
Issue a `SELECT` statement to a module with id `sqlite`.
+
```yaml
- type: db.query
params:
module: sqlite
query: "SELECT * from users;"
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/debug/log.mdx b/src/content/docs/processors/debug/log.mdx
index 096aa92..2f646a2 100644
--- a/src/content/docs/processors/debug/log.mdx
+++ b/src/content/docs/processors/debug/log.mdx
@@ -1,14 +1,15 @@
---
title: Debug Log
sidebar:
- label: Log
- order: 1
+ label: Log
+ order: 1
---
- **type**: `debug.log`
-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.
+ 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
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/filter/change.mdx b/src/content/docs/processors/filter/change.mdx
index 5d54289..24fd8e3 100644
--- a/src/content/docs/processors/filter/change.mdx
+++ b/src/content/docs/processors/filter/change.mdx
@@ -1,16 +1,16 @@
---
title: Filter On Change
sidebar:
- label: On Change
- order: 3
+ label: On Change
+ order: 3
---
This processor will only pass messages through if the value of the message has changed since the last time a message was processed. This processor is useful for filtering out duplicate messages that may be emitted by a module or processor.
- **type**: `filter.change`
-
### Example
+
```yaml
- type: filter.change
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/filter/expr.mdx b/src/content/docs/processors/filter/expr.mdx
index 79410cf..0d09447 100644
--- a/src/content/docs/processors/filter/expr.mdx
+++ b/src/content/docs/processors/filter/expr.mdx
@@ -1,19 +1,22 @@
---
title: Expr Filter
sidebar:
- label: Expr
- order: 2
+ label: Expr
+ order: 2
---
+
The `filter.expr` processor evaluates an [Expr expression](https://expr-lang.org/playground). If the expression evaluates to true then the payload is sent through. This processor will return an error if the expression fails to evaluate.
- **type**: `filter.expr`
- **params**:
- - **expression**: [Expr expression](https://expr-lang.org/playground) to evaluate. The expression has access to the [wrapped payload](/concepts/payload).
+ - **expression**: [Expr expression](https://expr-lang.org/playground) to evaluate. The expression has access to the [wrapped payload](/concepts/payload).
### Example
+
Match a payload great than or equal to 0
+
```yaml
- type: filter.expr
params:
pattern: "Payload >= 0"
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/filter/regex.mdx b/src/content/docs/processors/filter/regex.mdx
index 6e6dbd6..d117bba 100644
--- a/src/content/docs/processors/filter/regex.mdx
+++ b/src/content/docs/processors/filter/regex.mdx
@@ -1,19 +1,22 @@
---
title: Regex Filter
sidebar:
- label: Regex
- order: 1
+ label: Regex
+ order: 1
---
+
The `filter.regex` processor matches incoming string payload against a regular expression. If there is a match then the payload is sent through. This processor will return an error if the message being processed is not a string.
- **type**: `filter.regex`
- **params**:
- - **pattern**: regex pattern to match against the incoming string
+ - **pattern**: regex pattern to match against the incoming string
### Example
+
Match strings starting with `hello`
+
```yaml
- type: filter.regex
params:
pattern: "^hello.*"
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/float/parse.mdx b/src/content/docs/processors/float/parse.mdx
index f734f72..de2fc28 100644
--- a/src/content/docs/processors/float/parse.mdx
+++ b/src/content/docs/processors/float/parse.mdx
@@ -1,19 +1,22 @@
---
title: Parse Float
sidebar:
- label: Parse
- order: 1
+ label: Parse
+ order: 1
---
+
The `float.parse` processor takes a string and parses it as a float with the specified `base` and `bitSize`. This processor will return an error if the message being processed is not a string or if the string cannot be parsed into a float.
- **type**: `float.parse`
- **params**:
- - **bitSize**: (optional) the bit size of the float to parse, defaults to 64
+ - **bitSize**: (optional) the bit size of the float to parse, defaults to 64
### 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
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/float/random.mdx b/src/content/docs/processors/float/random.mdx
index f5354d6..e40bb8f 100644
--- a/src/content/docs/processors/float/random.mdx
+++ b/src/content/docs/processors/float/random.mdx
@@ -1,23 +1,26 @@
---
title: Create Random Float
sidebar:
- label: Random
- order: 2
+ label: Random
+ order: 2
---
+
The `float.random` processor will set the payload to a random float between the specified `min` and `max` value.
- **type**: `float.random`
- **params**:
- - **bitSize**: (optional) the bit size of the float to generate, defaults to 32
- - **min**: the minimum value for the random float (inclusive).
- - **max**: the maximum value for the random float (exclusive).
+ - **bitSize**: (optional) the bit size of the float to generate, defaults to 32
+ - **min**: the minimum value for the random float (inclusive).
+ - **max**: the maximum value for the random float (exclusive).
### 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
min: 1.0
max: 1.5
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/free-d/create.mdx b/src/content/docs/processors/free-d/create.mdx
index 92713a8..87991c3 100644
--- a/src/content/docs/processors/free-d/create.mdx
+++ b/src/content/docs/processors/free-d/create.mdx
@@ -1,26 +1,26 @@
---
title: Create FreeD
sidebar:
- label: Create
- order: 1
+ label: Create
+ order: 1
---
This processor will create a new FreeD message with the specified parameters.
- **type**: `free.d.create`
- **params**:
- - **id**: the ID to set for the FreeD message
- - **pan**: the pan value to set for the FreeD message
- - **tilt**: the tilt value to set for the FreeD message
- - **roll**: the roll value to set for the FreeD message
- - **posX**: the X position value to set for the FreeD message
- - **posY**: the Y position value to set for the FreeD message
- - **posZ**: the Z position value to set for the FreeD message
- - **zoom**: the zoom value to set for the FreeD message
- - **focus**: the focus value to set for the FreeD message
-
+ - **id**: the ID to set for the FreeD message
+ - **pan**: the pan value to set for the FreeD message
+ - **tilt**: the tilt value to set for the FreeD message
+ - **roll**: the roll value to set for the FreeD message
+ - **posX**: the X position value to set for the FreeD message
+ - **posY**: the Y position value to set for the FreeD message
+ - **posZ**: the Z position value to set for the FreeD message
+ - **zoom**: the zoom value to set for the FreeD message
+ - **focus**: the focus value to set for the FreeD message
### Example
+
```yaml
- type: free.d.create
params:
@@ -33,4 +33,4 @@ This processor will create a new FreeD message with the specified parameters.
posZ: "15"
zoom: "2"
focus: "1"
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/free-d/decode.mdx b/src/content/docs/processors/free-d/decode.mdx
index 8f92281..b9c1689 100644
--- a/src/content/docs/processors/free-d/decode.mdx
+++ b/src/content/docs/processors/free-d/decode.mdx
@@ -1,8 +1,8 @@
---
title: Decode FreeD
sidebar:
- label: Decode
- order: 3
+ label: Decode
+ order: 3
---
This processor will decode incoming bytes into a FreeD message. This processor will return an error if the message being processed is not an array of bytes.
@@ -10,6 +10,7 @@ This processor will decode incoming bytes into a FreeD message. This processor w
- **type**: `free.d.decode`
### Example
+
```yaml
- type: free.d.decode
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/free-d/encode.mdx b/src/content/docs/processors/free-d/encode.mdx
index df57d19..42fa222 100644
--- a/src/content/docs/processors/free-d/encode.mdx
+++ b/src/content/docs/processors/free-d/encode.mdx
@@ -1,8 +1,8 @@
---
title: Encode FreeD
sidebar:
- label: Encode
- order: 2
+ label: Encode
+ order: 2
---
This processor will encode a FreeD message into an array of bytes. This processor will return an error if the message being processed is not a FreeD message.
@@ -10,6 +10,7 @@ This processor will encode a FreeD message into an array of bytes. This processo
- **type**: `free.d.encode`
### Example
+
```yaml
- type: free.d.encode
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/http/request/do.mdx b/src/content/docs/processors/http/request/do.mdx
index 9e8d22c..8b9e1e5 100644
--- a/src/content/docs/processors/http/request/do.mdx
+++ b/src/content/docs/processors/http/request/do.mdx
@@ -1,23 +1,24 @@
---
title: Make HTTP Request
sidebar:
- label: Make Request
- order: 1
+ label: Make Request
+ order: 1
---
This process will make an HTTP request to the specified URL using the specified method. The response will be passed through to the next processor in the chain. This processor will return an error if the request fails for any reason (e.g. network error, invalid URL, etc.).
- **type**: `http.request.do`
- **params**:
- - **method**: the HTTP method to use for the request (e.g. `GET`, `POST`, `PUT`, etc.)
- - **url**: the URL to send the request to
-
+ - **method**: the HTTP method to use for the request (e.g. `GET`, `POST`, `PUT`, etc.)
+ - **url**: the URL to send the request to
### Example
+
Make a GET request to `https://example.com`
+
```yaml
- type: http.request.do
params:
method: GET
url: https://example.com
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/http/response/create.mdx b/src/content/docs/processors/http/response/create.mdx
index 3101150..82cef23 100644
--- a/src/content/docs/processors/http/response/create.mdx
+++ b/src/content/docs/processors/http/response/create.mdx
@@ -1,22 +1,24 @@
---
title: Create HTTP Response
sidebar:
- label: Create
- order: 2
+ label: Create
+ order: 2
---
This processor will create a new HTTP response with the specified status code and body template. The created response will be passed through to the next processor in the chain. If the response is subsequently sent to an HTTP server module using the [router.output](../router/output.md) processor, the status code and body template set by this processor will be used for the response sent to the client. This processor will return an error if there is an issue executing the body template.
- **type**: `http.response.create`
- **params**:
- - **status**: the HTTP status code to set for the response (e.g. `200`, `404`, etc.)
- - **body**: the body template to set for the response
+ - **status**: the HTTP status code to set for the response (e.g. `200`, `404`, etc.)
+ - **body**: the body template to set for the response
### 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
body: "OK"
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/int/parse.mdx b/src/content/docs/processors/int/parse.mdx
index dfbae73..362c6f9 100644
--- a/src/content/docs/processors/int/parse.mdx
+++ b/src/content/docs/processors/int/parse.mdx
@@ -1,20 +1,23 @@
---
title: Parse Int
sidebar:
- label: Parse
- order: 1
+ label: Parse
+ order: 1
---
+
The `int.parse` processor takes a string and parses it as an integer with the specified `base` and `bitSize`. This processor will return an error if the message being processed is not a string or if the string cannot be parsed into an integer.
- **type**: `int.parse`
- **params**:
- - **base**: (optional) the base to use for parsing the integer, defaults to 10
- - **bitSize**: (optional) the bit size of the integer to parse, defaults to 64
+ - **base**: (optional) the base to use for parsing the integer, defaults to 10
+ - **bitSize**: (optional) the bit size of the integer to parse, defaults to 64
### 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
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/int/random.mdx b/src/content/docs/processors/int/random.mdx
index 8b115c8..fa9797b 100644
--- a/src/content/docs/processors/int/random.mdx
+++ b/src/content/docs/processors/int/random.mdx
@@ -1,20 +1,23 @@
---
title: Create Random Int
sidebar:
- order: 2
+ order: 2
---
+
The `int.random` processor will set the payload to a random integer between the specified `min` and `max` value.
- **type**: `int.random`
- **params**:
- - **min**: the minimum value for the random integer (inclusive).
- - **max**: the maximum value for the random integer (inclusive).
+ - **min**: the minimum value for the random integer (inclusive).
+ - **max**: the maximum value for the random integer (inclusive).
### 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
max: 127
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/int/scale.mdx b/src/content/docs/processors/int/scale.mdx
index f1bf298..9862512 100644
--- a/src/content/docs/processors/int/scale.mdx
+++ b/src/content/docs/processors/int/scale.mdx
@@ -1,21 +1,23 @@
---
title: Scale Int
sidebar:
- label: Scale
- order: 3
+ label: Scale
+ order: 3
---
This processor will scale an integer value from one range to another. This processor will return an error if the message being processed is not an integer or if the parameters are not valid (e.g. if `inMin` is greater than or equal to `inMax`, etc.).
- **type**: `int.scale`
- **params**:
- - **inMin**: the minimum value of the input range
- - **inMax**: the maximum value of the input range
- - **outMin**: the minimum value of the output range
- - **outMax**: the maximum value of the output range
+ - **inMin**: the minimum value of the input range
+ - **inMax**: the maximum value of the input range
+ - **outMin**: the minimum value of the output range
+ - **outMax**: the maximum value of the output range
### Example
+
Scale an integer value from the range 0-255 to the range 0-100
+
```yaml
- type: int.scale
params:
@@ -23,4 +25,4 @@ Scale an integer value from the range 0-255 to the range 0-100
inMax: 255
outMin: 0
outMax: 100
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/json/decode.mdx b/src/content/docs/processors/json/decode.mdx
index 0ca8a8c..591d123 100644
--- a/src/content/docs/processors/json/decode.mdx
+++ b/src/content/docs/processors/json/decode.mdx
@@ -1,13 +1,16 @@
---
title: Decode JSON
sidebar:
- label: Decode
- order: 2
+ label: Decode
+ order: 2
---
+
Convert an incoming byte array or raw string into a JSON object. This processor will return an error if the message being processed is not an array of bytes or a raw string, or if the bytes/string cannot be parsed as JSON.
+
- **type**: `json.decode`
### Example
+
```yaml
- type: json.decode
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/json/encode.mdx b/src/content/docs/processors/json/encode.mdx
index f353124..ba1ba71 100644
--- a/src/content/docs/processors/json/encode.mdx
+++ b/src/content/docs/processors/json/encode.mdx
@@ -1,16 +1,16 @@
---
title: Encode JSON
sidebar:
- label: Encode
- order: 1
+ label: Encode
+ order: 1
---
This processor will encode an incoming object into a JSON byte array. This processor will return an error if the message being processed is not able to be serialized as JSON.
- **type**: `json.encode`
-
### Example
+
```yaml
- type: json.encode
```
diff --git a/src/content/docs/processors/kv/get.mdx b/src/content/docs/processors/kv/get.mdx
index 2e25317..c43632c 100644
--- a/src/content/docs/processors/kv/get.mdx
+++ b/src/content/docs/processors/kv/get.mdx
@@ -1,21 +1,24 @@
---
title: Get Key/Value
sidebar:
- label: Get
- order: 1
+ label: Get
+ order: 1
---
+
The `kv.get` processor gets the value associated with a key from a compatible module. The output payload is the value if the key is found.
- **type**: `kv.get`
- **params**:
- - **module**: id of the module
- - **key**: the key to look up
+ - **module**: id of the module
+ - **key**: the key to look up
### 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
key: counter
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/kv/set.mdx b/src/content/docs/processors/kv/set.mdx
index 0a365d6..b164c6f 100644
--- a/src/content/docs/processors/kv/set.mdx
+++ b/src/content/docs/processors/kv/set.mdx
@@ -1,23 +1,26 @@
---
title: Set Key/Value
sidebar:
- label: Set
- order: 2
+ label: Set
+ order: 2
---
+
The `kv.set` processor sets the value associated with a key from a compatible module. The payload is unchanged so whatever is received by this payload is output unless any errors are encountered.
- **type**: `kv.set`
- **params**:
- - **module**: id of the module
- - **key**: the key to look up
- - **value**: the value to set
+ - **module**: id of the module
+ - **key**: the key to look up
+ - **value**: the value to set
### 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
key: hello
value: world
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/midi/control_change/create.mdx b/src/content/docs/processors/midi/control_change/create.mdx
index 148e685..279bffc 100644
--- a/src/content/docs/processors/midi/control_change/create.mdx
+++ b/src/content/docs/processors/midi/control_change/create.mdx
@@ -1,22 +1,24 @@
---
-title: Create MIDI Control Change
+title: Create MIDI Control Change
sidebar:
- label: Create
- order: 1
+ label: Create
+ order: 1
---
+
This processor will create a MIDI Control Change message with the specified channel, control number, and control value.
- **type**: `midi.control_change.create`
- **params**:
- - **channel**: the MIDI channel
- - **control**: the control number
- - **value**: the control value
+ - **channel**: the MIDI channel
+ - **control**: the control number
+ - **value**: the control value
### Example
+
```yaml
- type: midi.control_change.create
params:
channel: "1"
control: "64"
value: "127"
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/midi/message/decode.mdx b/src/content/docs/processors/midi/message/decode.mdx
index 075b0c1..144900c 100644
--- a/src/content/docs/processors/midi/message/decode.mdx
+++ b/src/content/docs/processors/midi/message/decode.mdx
@@ -1,14 +1,16 @@
---
title: Decode MIDI Message
sidebar:
- label: Decode
- order: 3
+ label: Decode
+ order: 3
---
+
This processor will decode incoming bytes into a MIDI message. This processor will return an error if the message being processed is not an array of bytes.
- **type**: `midi.message.decode`
### Example
+
```yaml
- type: midi.message.decode
```
diff --git a/src/content/docs/processors/midi/message/encode.mdx b/src/content/docs/processors/midi/message/encode.mdx
index 70a35ee..800d033 100644
--- a/src/content/docs/processors/midi/message/encode.mdx
+++ b/src/content/docs/processors/midi/message/encode.mdx
@@ -1,14 +1,16 @@
---
title: Encode MIDI Message
sidebar:
- label: Encode
- order: 2
+ label: Encode
+ order: 2
---
+
This processor will encode a MIDI message into an array of bytes. This processor will return an error if the message being processed is not a MIDI message.
- **type**: `midi.message.encode`
### Example
+
```yaml
- type: midi.message.encode
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/midi/message/unpack.mdx b/src/content/docs/processors/midi/message/unpack.mdx
index 6d462d0..5d884fa 100644
--- a/src/content/docs/processors/midi/message/unpack.mdx
+++ b/src/content/docs/processors/midi/message/unpack.mdx
@@ -1,14 +1,16 @@
---
title: Unpack MIDI Message
sidebar:
- label: Unpack
- order: 4
+ label: Unpack
+ order: 4
---
+
This processor will unpack a MIDI message into its individual components. This processor will return an error if the message being processed is not a MIDI message.
- **type**: `midi.message.unpack`
### Example
+
```yaml
- type: midi.message.unpack
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/midi/note_off/create.mdx b/src/content/docs/processors/midi/note_off/create.mdx
index d9fae87..87f0b10 100644
--- a/src/content/docs/processors/midi/note_off/create.mdx
+++ b/src/content/docs/processors/midi/note_off/create.mdx
@@ -1,22 +1,24 @@
---
-title: Create MIDI Note On
+title: Create MIDI Note On
sidebar:
- label: Create
- order: 1
+ label: Create
+ order: 1
---
+
This processor will create a MIDI Note On message with the specified channel, note, and velocity.
- **type**: `midi.note_on.create`
- **params**:
- - **channel**: the MIDI channel
- - **note**: the note number
- - **velocity**: the velocity
+ - **channel**: the MIDI channel
+ - **note**: the note number
+ - **velocity**: the velocity
### Example
+
```yaml
- type: midi.note_on.create
params:
channel: "1"
note: "60"
velocity: "127"
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/midi/note_on/create.mdx b/src/content/docs/processors/midi/note_on/create.mdx
index 568ddcb..bf8c579 100644
--- a/src/content/docs/processors/midi/note_on/create.mdx
+++ b/src/content/docs/processors/midi/note_on/create.mdx
@@ -1,22 +1,24 @@
---
-title: Create MIDI Note Off
+title: Create MIDI Note Off
sidebar:
- label: Create
- order: 1
+ label: Create
+ order: 1
---
+
This processor will create a MIDI Note Off message with the specified channel, note, and velocity.
- **type**: `midi.note_off.create`
- **params**:
- - **channel**: the MIDI channel
- - **note**: the note number
- - **velocity**: the velocity
+ - **channel**: the MIDI channel
+ - **note**: the note number
+ - **velocity**: the velocity
### Example
+
```yaml
- type: midi.note_off.create
params:
channel: "1"
note: "60"
velocity: "127"
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/midi/program_change/create.mdx b/src/content/docs/processors/midi/program_change/create.mdx
index 4c5b9eb..e847206 100644
--- a/src/content/docs/processors/midi/program_change/create.mdx
+++ b/src/content/docs/processors/midi/program_change/create.mdx
@@ -1,20 +1,22 @@
---
-title: Create MIDI Prgoram Change
+title: Create MIDI Prgoram Change
sidebar:
- label: Create
- order: 1
+ label: Create
+ order: 1
---
+
This processor will create a MIDI Program Change message with the specified channel and program number.
- **type**: `midi.program_change.create`
- **params**:
- - **channel**: the MIDI channel
- - **program**: the program number
+ - **channel**: the MIDI channel
+ - **program**: the program number
### Example
+
```yaml
- type: midi.program_change.create
params:
channel: "1"
program: "10"
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/mqtt/message/create.mdx b/src/content/docs/processors/mqtt/message/create.mdx
index 9e2ec57..58a184c 100644
--- a/src/content/docs/processors/mqtt/message/create.mdx
+++ b/src/content/docs/processors/mqtt/message/create.mdx
@@ -1,18 +1,20 @@
---
title: Create MQTT Message
sidebar:
- order: 1
+ order: 1
---
+
This processor will create an MQTT message from the provided parameters. This processor will return an error if any of the required parameters are missing or if the parameters are of the wrong type.
- **type**: `mqtt.message.create`
- **params**:
- - **topic**: the topic to publish the message to.
- - **qos**: the QoS level of the message.
- - **retained**: whether the message should be retained by the broker.
- - **payload**: the payload of the message. This can be a string or a byte array.
+ - **topic**: the topic to publish the message to.
+ - **qos**: the QoS level of the message.
+ - **retained**: whether the message should be retained by the broker.
+ - **payload**: the payload of the message. This can be a string or a byte array.
### Example
+
```yaml
- type: mqtt.message.create
params:
@@ -20,4 +22,4 @@ This processor will create an MQTT message from the provided parameters. This pr
qos: 1
retained: false
payload: "Hello, World!"
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/nats/message/create.mdx b/src/content/docs/processors/nats/message/create.mdx
index cb4b218..dc7d9e1 100644
--- a/src/content/docs/processors/nats/message/create.mdx
+++ b/src/content/docs/processors/nats/message/create.mdx
@@ -1,20 +1,22 @@
---
title: Create NATS Message
sidebar:
- label: Create
- order: 1
+ label: Create
+ order: 1
---
This processor will create a NATS message from the provided parameters. This processor will return an error if any of the required parameters are missing or if the parameters are of the wrong type.
+
- **type**: `nats.message.create`
- **params**:
- - **subject**: the subject to publish the message to.
- - **payload**: the payload of the message.
+ - **subject**: the subject to publish the message to.
+ - **payload**: the payload of the message.
### Example
+
```yaml
- type: nats.message.create
params:
subject: "events"
payload: "Hello, World!"
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/osc/message/create.mdx b/src/content/docs/processors/osc/message/create.mdx
index 0da2525..de670ff 100644
--- a/src/content/docs/processors/osc/message/create.mdx
+++ b/src/content/docs/processors/osc/message/create.mdx
@@ -1,18 +1,20 @@
---
title: Create OSC Message
sidebar:
- label: Create
- order: 1
+ label: Create
+ order: 1
---
+
This processor will create an OSC message from the provided parameters. This processor will return an error if any of the required parameters are missing or if the parameters are of the wrong type. The address parameter is required, while the args and types parameters are optional. However, if args are provided, then types must also be provided and must match the amount of args provided.
- **type**: `osc.message.create`
- **params**:
- - **address**: the address of the OSC message.
- - **args**: (optional) array of string templates for each argument.
- - **types**: (optional) a single string with the of each arg in order. This is required if args are provided.
+ - **address**: the address of the OSC message.
+ - **args**: (optional) array of string templates for each argument.
+ - **types**: (optional) a single string with the of each arg in order. This is required if args are provided.
### Example
+
Create an OSC message with the address `/test/message` and two integer arguments from the payload of the message being processed.
```yaml
@@ -21,4 +23,4 @@ Create an OSC message with the address `/test/message` and two integer arguments
address: "/test/message"
args: ["{{.Payload[0]}}", "{{.Payload[1]}}"]
types: "ii"
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/osc/message/decode.mdx b/src/content/docs/processors/osc/message/decode.mdx
index c214ddd..65214e6 100644
--- a/src/content/docs/processors/osc/message/decode.mdx
+++ b/src/content/docs/processors/osc/message/decode.mdx
@@ -1,14 +1,16 @@
---
title: Decode OSC Message
sidebar:
- label: Decode
- order: 3
+ label: Decode
+ order: 3
---
+
The `osc.message.decode` processor takes a array of bytes and turn it into OSC message if it can be. This processor will return an error if the bytes cannot be parsed as an OSC message
- **type**: `osc.message.decode`
### Example
+
```yaml
- type: osc.message.encode
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/osc/message/encode.mdx b/src/content/docs/processors/osc/message/encode.mdx
index 6fcd7b6..360911a 100644
--- a/src/content/docs/processors/osc/message/encode.mdx
+++ b/src/content/docs/processors/osc/message/encode.mdx
@@ -1,14 +1,16 @@
---
title: Encode OSC Message
sidebar:
- label: Encode
- order: 2
+ label: Encode
+ order: 2
---
+
The `osc.message.encode` processor takes an OSC message and turns it into an array of bytes. This processor will return an error if the OSC message cannot be turned into bytes.
- **type**: `osc.message.encode`
### Example
+
```yaml
- type: osc.message.encode
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/router/output.mdx b/src/content/docs/processors/router/output.mdx
index 0880853..b5a2fb6 100644
--- a/src/content/docs/processors/router/output.mdx
+++ b/src/content/docs/processors/router/output.mdx
@@ -1,21 +1,22 @@
---
title: Output from Router
sidebar:
- label: Output
- order: 1
+ label: Output
+ order: 1
---
+
The `router.output` processor takes any payload and outputs to the specified module.
- **type**: `router.output`
- **params**:
- - **module**: the id of the [module](/concepts/modules) to output to.
-
+ - **module**: the id of the [module](/concepts/modules) to output to.
### Example
+
Output to the `osc-out` module.
```yaml
- type: router.output
params:
module: osc-out
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/script/expr.mdx b/src/content/docs/processors/script/expr.mdx
index f7e98be..a05b2fd 100644
--- a/src/content/docs/processors/script/expr.mdx
+++ b/src/content/docs/processors/script/expr.mdx
@@ -1,19 +1,22 @@
---
title: Execute Expr Expression
sidebar:
- label: Expr
- order: 2
+ label: Expr
+ order: 2
---
+
The processor will execute the provided Expr expression and return the result as the new payload. This processor will return an error if the expression cannot be executed or if there is an error during execution. The expression will have access to the [wrapped payload](/concepts/payloads).
+
- **type**: `script.expr`
- **params**:
- - **expression**: the Expr expressiont to execute.
+ - **expression**: the Expr expressiont to execute.
### Example
+
This example will add 1 to the wrapped payload.
```yaml
- type: script.expr
params:
expression: "Payload + 1"
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/script/js.mdx b/src/content/docs/processors/script/js.mdx
index 5e28bfa..380cd0b 100644
--- a/src/content/docs/processors/script/js.mdx
+++ b/src/content/docs/processors/script/js.mdx
@@ -1,8 +1,8 @@
---
title: Execute JavaScript
sidebar:
- label: JavaScript
- order: 1
+ label: JavaScript
+ order: 1
---
The `script.js` processor takes in any payload type and executes a JavaScript function that is able to process the payload. The end value of `payload` will be returned as the output of the processor.
@@ -13,13 +13,15 @@ This run your JavaScript program in a [sandboxed environment](https://gitlab.com
- **type**: `script.js`
- **params**:
- - **program**: The JavaScript program to run. The payload is available as a global variable called `payload`.
+ - **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: |
- payload = payload.replaceAll('|',',');
-```
\ No newline at end of file
+ payload = payload.replaceAll('|',',');
+```
diff --git a/src/content/docs/processors/script/wasm.mdx b/src/content/docs/processors/script/wasm.mdx
index fed8649..fb5926d 100644
--- a/src/content/docs/processors/script/wasm.mdx
+++ b/src/content/docs/processors/script/wasm.mdx
@@ -1,22 +1,25 @@
---
title: Run WASM (Extism) Plugin
sidebar:
- label: WASM
- order: 3
+ label: WASM
+ order: 3
---
+
This processor will load and execute a WASM plugin using the [Extism](https://extism.org/) runtime. The processor will execute the specified function in the WASM plugin and return the result as the new payload. This processor will return an error if the plugin cannot be loaded, if the function cannot be executed, or if there is an error during execution. The incoming payload will be passed as the argument to the WASM function. If the plugin is successfully executed, the result of the function will be returned as the new payload.
- **type**: `script.wasm`
- **params**:
- - **path**: the path to the WASM plugin to load.
- - **function**: (optional) the function to execute in the WASM plugin defaults to `process`
- - **enableWasi**: (optional) whether to enable WASI for the plugin defaults to `false`
+ - **path**: the path to the WASM plugin to load.
+ - **function**: (optional) the function to execute in the WASM plugin defaults to `process`
+ - **enableWasi**: (optional) whether to enable WASI for the plugin defaults to `false`
### Example
+
This example will load the plugin at `./test.wasm` and execute the `test` function
+
```yaml
- type: script.wasm
params:
path: "./test.wasm"
function: "test"
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/sip/response/audio/create.mdx b/src/content/docs/processors/sip/response/audio/create.mdx
index e68795f..22f7a7f 100644
--- a/src/content/docs/processors/sip/response/audio/create.mdx
+++ b/src/content/docs/processors/sip/response/audio/create.mdx
@@ -1,23 +1,26 @@
---
title: Create SIP Audio Response
sidebar:
- label: Create
- order: 1
+ label: Create
+ order: 1
---
+
This processor will create a SIP response message with an audio file as the payload. If this message is output to a SIP module using the [router.output](/processors/router/output) processor, then the SIP module will send the response to the caller and play the audio file included in the response.
- **type**: `sip.response.audio.create`
- **params**:
- - **preWait**: the amount of time in milliseconds to wait before sending the response
- - **audioFile**: the path to the audio file to include in the response
- - **postWait**: the amount of time in milliseconds to wait after sending the response
+ - **preWait**: the amount of time in milliseconds to wait before sending the response
+ - **audioFile**: the path to the audio file to include in the response
+ - **postWait**: the amount of time in milliseconds to wait after sending the response
### 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
audioFile: "response.wav"
postWait: 1000
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/sip/response/dtmf/create.mdx b/src/content/docs/processors/sip/response/dtmf/create.mdx
index 5a68726..e788fc4 100644
--- a/src/content/docs/processors/sip/response/dtmf/create.mdx
+++ b/src/content/docs/processors/sip/response/dtmf/create.mdx
@@ -1,23 +1,26 @@
---
title: Create SIP DTMF Response
sidebar:
- label: Create
- order: 1
+ label: Create
+ order: 1
---
+
This processor will create a SIP DTMF response from the provided parameters. If this message is output to a SIP module using the [router.output](/processors/router/output) processor, then the SIP module will send the response to the caller and play the DTMF tones specified.
- **type**: `sip.response.dtmf.create`
- **params**:
- - **preWait**: the amount of time in milliseconds to wait before sending the response
- - **digits**: the DTMF digits to include in the response
- - **postWait**: the amount of time in milliseconds to wait after sending the response
+ - **preWait**: the amount of time in milliseconds to wait before sending the response
+ - **digits**: the DTMF digits to include in the response
+ - **postWait**: the amount of time in milliseconds to wait after sending the response
### 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
digits: "1234"
postWait: 1000
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/string/create.mdx b/src/content/docs/processors/string/create.mdx
index ecc9cc0..68b3800 100644
--- a/src/content/docs/processors/string/create.mdx
+++ b/src/content/docs/processors/string/create.mdx
@@ -1,19 +1,22 @@
---
title: Create String
sidebar:
- label: Create
- order: 3
+ label: Create
+ order: 3
---
+
The `string.create` processor creates a string based on the provided template. This processor will return an error if there is an issue executing the template. The template property is just a [Go template](https://pkg.go.dev/text/template) that will be evaluated with the incoming message provided as an environment.
- **type**: `string.create`
- **params**:
- - **template**: string template that will have the incoming message as the context
+ - **template**: string template that will have the incoming message as the context
### Example
+
This would create a string using the `Address` property of the incoming message like and OSC message
+
```yaml
- type: string.create
- params:
+ params:
template: "{{.Address}}
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/string/decode.mdx b/src/content/docs/processors/string/decode.mdx
index 63823e5..00613c5 100644
--- a/src/content/docs/processors/string/decode.mdx
+++ b/src/content/docs/processors/string/decode.mdx
@@ -1,14 +1,16 @@
---
title: Decode String
sidebar:
- label: Decode
- order: 1
+ label: Decode
+ order: 1
---
+
The `string.decode` processor takes a array of bytes and turn it into string. This processor will return an error if the message being processed is not an array of bytes.
- **type**: `string.decode`
### Example
+
```yaml
- type: string.decode
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/string/encode.mdx b/src/content/docs/processors/string/encode.mdx
index fe4c36e..e6d48b7 100644
--- a/src/content/docs/processors/string/encode.mdx
+++ b/src/content/docs/processors/string/encode.mdx
@@ -1,14 +1,16 @@
---
title: Encode String
sidebar:
- label: Encode
- order: 2
+ label: Encode
+ order: 2
---
+
The `string.encode` processor takes a string and turns it into an array of bytes. This processor will return an error if the message being processed is not a string.
- **type**: `string.encode`
### Example
+
```yaml
- type: string.encode
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/string/split.mdx b/src/content/docs/processors/string/split.mdx
index 1928881..dcd747c 100644
--- a/src/content/docs/processors/string/split.mdx
+++ b/src/content/docs/processors/string/split.mdx
@@ -1,20 +1,22 @@
---
title: Split String
sidebar:
- label: Split
- order: 5
+ label: Split
+ order: 5
---
+
The `string.split` processor takes a string and turns it into an array of strings by splitting on `params.separator`. This processor will return an error if the message being processed is not a string.
- **type**: `string.split`
- **params**:
- - **pattern**: string to split incoming string on
+ - **pattern**: string to split incoming string on
### Example
+
Split incoming string on `,` i.e `"one,two,three"` -> `["one","two","three"]`
```yaml
- type: string.split
params:
separator: ","
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/processors/time/sleep.mdx b/src/content/docs/processors/time/sleep.mdx
index 4f1845e..230fc76 100644
--- a/src/content/docs/processors/time/sleep.mdx
+++ b/src/content/docs/processors/time/sleep.mdx
@@ -1,19 +1,22 @@
---
title: Sleep
sidebar:
- label: Sleep
- order: 1
+ label: Sleep
+ order: 1
---
+
The `time.sleep` processor will sleep for the specified `duration` in milliseconds before passing the message to the next processor.
- **type**: `time.sleep`
- **params**:
- - **duration**: the duration to sleep in milliseconds
+ - **duration**: the duration to sleep in milliseconds
### Example
+
This would sleep for 5 seconds before passing the message to the next processor.
+
```yaml
- type: time.sleep
params:
duration: 5000
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/run/cli.mdx b/src/content/docs/run/cli.mdx
index 7781dd3..3f362d4 100644
--- a/src/content/docs/run/cli.mdx
+++ b/src/content/docs/run/cli.mdx
@@ -4,26 +4,28 @@ sidebar:
order: 1
---
-import { Steps } from '@astrojs/starlight/components';
+import { Steps } from "@astrojs/starlight/components";
1. install
+ - via go: `go install github.com/jwetzell/showbridge-go/cmd/showbridge@latest`
- - via go: `go install github.com/jwetzell/showbridge-go/cmd/showbridge@latest`
-
- - [binaries](https://github.com/jwetzell/showbridge-go/releases/latest)
+ -
+ binaries
+
2. create a config file (see [config](/concepts/config/))
-
3. run
+ - `showbridge --config config.yaml`
- - `showbridge --config config.yaml`
+ - see below for all flags
- - see below for all flags
-
- - use the `-h` flag to see other available flags
+ - use the `-h` flag to see other available flags
@@ -41,4 +43,4 @@ GLOBAL OPTIONS:
--trace enable OpenTelemetry tracing [$SHOWBRIDGE_TRACE]
--help, -h show help
--version, -v print the version
-```
\ No newline at end of file
+```
diff --git a/src/content/docs/run/docker.mdx b/src/content/docs/run/docker.mdx
index fefabed..b534575 100644
--- a/src/content/docs/run/docker.mdx
+++ b/src/content/docs/run/docker.mdx
@@ -4,19 +4,16 @@ sidebar:
order: 2
---
-import { Steps, Code } from '@astrojs/starlight/components';
+import { Steps, Code } from "@astrojs/starlight/components";
1. create a config file (see [config](/concepts/config/))
+2. run
+ -
-3. run
+ - see [CLI Usage](/guides/cli-usage) for more detail on flags
+ - see [Docker docs](https://docs.docker.com/) for how to use docker
- -
-
- - see [CLI Usage](/guides/cli-usage) for more detail on flags
-
- - see [Docker docs](https://docs.docker.com/) for how to use docker
-
-
\ No newline at end of file
+
diff --git a/src/content/docs/run/source.mdx b/src/content/docs/run/source.mdx
index bab918c..81a260a 100644
--- a/src/content/docs/run/source.mdx
+++ b/src/content/docs/run/source.mdx
@@ -4,7 +4,7 @@ sidebar:
order: 3
---
-import { Steps } from '@astrojs/starlight/components';
+import { Steps } from "@astrojs/starlight/components";
1. clone repo
@@ -12,8 +12,7 @@ import { Steps } from '@astrojs/starlight/components';
2. install dependencies: `go mod tidy`
3. run cli:
-
- `go run ./cmd/showbridge --config config.yaml`
- see [CLI Usage](/guides/cli-usage) for more flags
-
+
diff --git a/src/content/docs/showbridge/dictionary.mdx b/src/content/docs/showbridge/dictionary.mdx
index 23f3b5f..76a00ce 100644
--- a/src/content/docs/showbridge/dictionary.mdx
+++ b/src/content/docs/showbridge/dictionary.mdx
@@ -1,21 +1,21 @@
---
title: Dictionary
sidebar:
- label: Dictionary
- order: 2
+ label: Dictionary
+ order: 2
---
- **router**: throughout documentation I will use the term router to refer to a configured/running instance of showbridge
- **modules**: modules are configured instances that can produce or consume message like a TCP server or a UDP client
- **routes**: routes take messages coming from a module (input), pass the
-- **processors**: processors process messages, this can be anything such as:
- - [decoding bytes into a string](/processors/string/decode)
- - [creating random numbers](/processors/int/random)
- - [filtering OSC message](/processors/osc/message/filter)
- - [running custom JavaScript snippets](/processors/script/js)
+- **processors**: processors process messages, this can be anything such as:
+ - [decoding bytes into a string](/processors/string/decode)
+ - [creating random numbers](/processors/int/random)
+ - [filtering OSC message](/processors/osc/message/filter)
+ - [running custom JavaScript snippets](/processors/script/js)
-import { Aside } from '@astrojs/starlight/components';
+import { Aside } from "@astrojs/starlight/components";
\ No newline at end of file
+ Router output is also handled by [a processor](/processors/router/output)!
+
diff --git a/src/content/docs/showbridge/overview.mdx b/src/content/docs/showbridge/overview.mdx
index f1e385c..aca755f 100644
--- a/src/content/docs/showbridge/overview.mdx
+++ b/src/content/docs/showbridge/overview.mdx
@@ -1,13 +1,14 @@
---
title: Overview
sidebar:
- label: Overview
- order: 1
+ label: Overview
+ order: 1
---
showbridge is a kind of re-imagining of [OSCulator](https://osculator.net/) taken way too far.
### Included Modules
+
- HTTP
- server
- UDP
@@ -28,7 +29,7 @@ showbridge is a kind of re-imagining of [OSCulator](https://osculator.net/) take
- call server
- [DTMF](https://en.wikipedia.org/wiki/DTMF_signaling) server
- MIDI
- - input (not included in pre-built binaries yet)
- - output (not included in pre-built binaries yet)
+ - input (not included in pre-built binaries yet)
+ - output (not included in pre-built binaries yet)
- Serial
- - client (not included in pre-built binaries yet)
\ No newline at end of file
+ - client (not included in pre-built binaries yet)