flb-plugin 0.1.1

Fluent Bit plugin binding for Rust
Documentation
  • Coverage
  • 52.38%
    11 out of 21 items documented1 out of 15 items with examples
  • Size
  • Source code size: 22.18 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.91 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 22s Average build duration of successful builds.
  • all releases: 22s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • KOBA789

flb-plugin - Fluent Bit plugin binding for Rust

struct Hello;
impl flb_plugin::output::Plugin for Hello {
    const NAME: &'static CStr = const_cstr!("hello");
    const DESCRIPTION: &'static CStr = const_cstr!("hello plugin");

    fn new(config: &output::Config) -> Self {
        let param = config.get_property(const_cstr!("param"));
        println!("[new] param: {:?}", param);
        Hello
    }

    fn flush(&mut self, tag: &str, mut data: &[u8]) -> Result<(), flb_plugin::Error> {
        let value = rmpv::decode::read_value_ref(&mut data).unwrap();
        println!("[flush] tag: {tag}, data: {:?}", value);
        Ok(())
    }

    fn exit(self) -> Result<(), flb_plugin::Error> {
        println!("[exit]");
        Ok(())
    }
}

flb_plugin::output_plugin_proxy!(Hello);