[][src]Crate cerk_config_loader_file

This is a package for CERK. CERK is an open source CloudEvents Router written in Rust with a MicroKernel architecture.

Introduction

CERK lets you route your CloudEvents between different different ports. Ports are transport layer bindings over which CloudEvents can be exchanged. It is built with modularity and portability in mind.

Components

CERK comes with a couple of prefabricated components, but implementing custom components is easy.

A good overview is provided on GitHub.

This Component: File Based Config Loader

This port loads configurations from a json file.

The file path could be set with the env variable CONFIG_PATH, default is ./config.json.

Example Config

{
  "routing_rules": [
    "dummy-logger-output"
  ],
  "ports": {
    "ampq-input": {
      "uri": "amqp://127.0.0.1:5672/%2f",
      "consume_channels": [
        {
          "name": "test",
          "ensure_queue": true,
          "bind_to_exchange": "test"
        }
      ],
      "publish_channels": [
        {
          "name": "test",
          "ensure_exchange": true
        }
      ]
    },
    "dummy-logger-output": null
  }
}

Examples

Statics

CONFIG_LOADER_FILE

This is the pointer for the main function to start the config loader.

Functions

config_loader_file_start

This is the main function to start the config loader.