4 releases (2 breaking)

0.3.1 Feb 12, 2024
0.2.0 Dec 7, 2023
0.1.11 Aug 15, 2023
0.1.0 Sep 15, 2021

#656 in Database interfaces

Download history 18/week @ 2024-02-09 12/week @ 2024-02-16 15/week @ 2024-02-23 6/week @ 2024-03-01 175/week @ 2024-03-08 15/week @ 2024-03-15 7/week @ 2024-03-29

197 downloads per month

Apache-2.0

795KB
18K SLoC

This library allows the creation of custom shotover transforms.

There are two consumers of this library:

Custom Transforms

To create a custom transform you need to implement these traits:

  • transforms::TransformConfig - Defines what configuration fields the transform has in the topology.yaml.
  • transforms::TransformBuilder - Defines how to build the Transform for a new incoming connection. Only one instance is created over shotovers runtime.
  • transforms::Transform - Defines the transformation logic of the transform. A new instance is created per incoming connection.

Simple transforms can implement all of these onto a single struct but generally you need seperate structs for each.

The shotover binary

All custom transforms the user wants to use are statically compiled into a single binary. The crate for this binary is very simple, it just consists of a main.rs like:

shotover::import_transform!(transform_crate::TransformConfig);

fn main() {
    shotover::runner::Shotover::new().run_block();
}

Dependencies

~30–50MB
~883K SLoC