A templating library for injecting variables from multiple external sources
This is a simple example showing how to pull values from the environment
```rust use germinate::Seed;
async fn main() { std::env::set_var("NAME", "John Wick"); let mut seed = Seed::new("Hi %env:NAME%!".into()); let output = seed.germinate().await.unwrap();
assert_eq!(String::from("Hi John Wick!"), output);
} ```
Germinate provides a CLI for templating files, available from the Github releases. To run the CLI, cimply download the binary for your system and check the usage with germinate --help
The CLI can be used to parse an template file and output it either to stdout
or optionally, an output file
```
germinate myfile.txt.tmpl
germinate myfile.txt.tmpl -o myfile.txt ```
Currently implemented sources:
env
- Load values from environment variablesawsssm
- Load values from the AWS Systems Manager Parameter Store
ssm:GetParameter
AWS IAM permissionawsec2metadata
- Load values from the AWS EC2 Metadata Serviceawsec2tag
- Load values from an EC2 instance's tags. This can only access tags on the instance running germinate
ec2:DescribeInstances
AWS IAM permissionFor an example of integrating your own value source, checkout the Seed
struct in the docs