trigon

command module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2021 License: MIT Imports: 16 Imported by: 0

README

trigon

Trigon connects to MySQL bin-log stream and processes it with different pipes

Configuration

# trigon.yaml
input:
  host: 127.0.0.1:3320
  user: root
  password: root
triggers:
  - name: "Post webhook after 1000 user creations"
    pipes:
      - ["table_filter", ["user"]]
      - ["action_filter", ["insert"]]
      - ["every", 1000]
      - ["debounce", 5000]
      - ["webhook", { url: https://hookb.in/mZaZlXYLpjueqq710Ypk, method: POST }]

  - name: "Start data aggregation on leads updates"
    pipes:
      - ["table_filter", ["lead"]]
      - ["action_filter", ["insert", "update"]]
      - ["every", 10000]
      - ["debounce", 3600000] # debounce for one hour
      - ["log", { prefix: "Calculate leads aggregation" }]
      - ["amqp", { dsn: "amqp://guest:guest@localhost:5672/", exchange: "lead", routing_key: "lead.aggregate" }]

  - name: "Try every pipe on transactions"
    pipes:
      - ["log", { prefix: "All in one start: ", output: "file", "path": "./log.log" }]
      - ["table_filter", ["transaction"]]
      - ["action_filter", ["insert", "update", "delete"]]
      - ["every", 2]
      - ["debounce", 5000]
      - ["webhook", { url: https://hookb.in/mZaZlXYLpjueqq710Ypk, method: POST }]
      - ["amqp", { dsn: "amqp://guest:guest@localhost:5672/", exchange: "test1", routing_key: "order" }]
      - ["log", { prefix: "All in one end: " }]

TODO

  • yaml config
    • input
    • triggers
      • pipes
      • output
  • tests
  • pipes

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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