hetzner_robot_rhai/src/scripting/mod.rs
Maxime Van Hees 6082ecc6d1 updates
2025-07-18 04:33:37 +02:00

32 lines
858 B
Rust

use crate::api::Client;
use crate::api::models::{Rescue, Linux, Vnc, Windows, Plesk, Cpanel, Boot, Server, SshKey};
use rhai::{Engine, Scope};
pub mod server;
pub mod ssh_keys;
pub mod boot;
pub mod printing;
pub fn setup_engine(client: Client) -> (Engine, Scope<'static>) {
let mut engine = Engine::new();
let mut scope = Scope::new();
engine.build_type::<Server>();
engine.build_type::<SshKey>();
engine.build_type::<Boot>();
engine.build_type::<Rescue>();
engine.build_type::<Linux>();
engine.build_type::<Vnc>();
engine.build_type::<Windows>();
engine.build_type::<Plesk>();
engine.build_type::<Cpanel>();
server::register(&mut engine);
ssh_keys::register(&mut engine);
boot::register(&mut engine);
printing::register(&mut engine);
scope.push("hetzner", client);
(engine, scope)
}