https://github.com/starryinternet/telegraf-plugin-rs
https://github.com/starryinternet/telegraf-plugin-rs
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/starryinternet/telegraf-plugin-rs
- Owner: StarryInternet
- License: mit
- Created: 2019-06-20T14:44:27.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-30T13:53:48.000Z (almost 7 years ago)
- Last Synced: 2025-03-30T07:23:27.978Z (about 1 year ago)
- Language: Rust
- Size: 23.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Telegraf Rust Plugin
Allowing you to write telegraf plugins in Rust.
## Adding to a project
Copy `makefile-template.toml` and `lib.go` from this project into the root of
your project directory.
Edit the `makefile-template.toml` script, specifically the location of where
your static library is built. Make sure to change your project to build a static
library with `crate_type = ["staticlib"]` in your `Cargo.toml`!
## How this works
Using some glue Go code a ["go plugin" ](https://golang.org/pkg/plugin/)
is generated to be used in telegraf. Rust talks to the Go using C FFI and is
statically linked into the resulting dynamic library.
A cargo make script is necessary because `go` needs to build the final artifact.
It generates magic in its `.so` that allows other Go code to load it at runtime.