-
Notifications
You must be signed in to change notification settings - Fork 0
Use pipelines as a base #12
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Instead of splitting plugins on producers and consumers, it's better to consider pipelines — read input and produce output.
Config then would looks like:
plugins:
- name: imap
bin: ./build/bin/imap-plugin.so
- name: telegram
bin: ./build/bin/telegram-plugin.so
pipelines:
- name: imap
plugin: imap
conf:
url: ${WOMBAT_IMAP_ADDRESS:-mail.dev:993}
username: ${WOMBAT_IMAP_USERNAME:-example@mail.dev}
password: ${WOMBAT_IMAP_PASSWORD:-password}
mailbox: ${WOMBAT_IMAP_MAILBOX:-Inbox}
idleTimeout: ${WOMBAT_IMAP_IDLE_TIMEOUT:-5000}
verbose: ${WOMBAT_IMAP_VERBOSE:-true}
- name: tg
plugin: telegram
conf:
token: ${WOMBAT_TELEGRAM_TOKEN:-example}
rules:
- name: imap_to_tg
producer: imap
consumer: tg
filter: 'true'
transform: |
{
"chat_id": 1234,
"content": self.?envelope.?subject
}
- name: tg_to_tg
producer: tg
consumer: tg
filter: |
self.chat_id == 1234
transform: |
{
"chat_id": 4321,
"content": self.content
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request