feat: Add encoderhero and heroscript_dumps/loads

- Add encoderhero import to multiple modules
- Implement heroscript_dumps and heroscript_loads functions
- Update several methods to use `if mut` for cleaner optionals
- Rename rclone globals for clarity
This commit is contained in:
Mahmoud-Emad
2025-10-13 21:49:19 +03:00
parent 25fbc61f49
commit f789564f51
21 changed files with 268 additions and 99 deletions

View File

@@ -1,6 +1,7 @@
module wireguard
import incubaid.herolib.data.paramsparser
import incubaid.herolib.data.encoderhero
pub const version = '1.14.3'
const singleton = false
@@ -36,3 +37,14 @@ fn obj_init(obj_ WireGuard) !WireGuard {
mut obj := obj_
return obj
}
/////////////NORMALLY NO NEED TO TOUCH
pub fn heroscript_dumps(obj WireGuard) !string {
return encoderhero.encode[WireGuard](obj)!
}
pub fn heroscript_loads(heroscript string) !WireGuard {
mut obj := encoderhero.decode[WireGuard](heroscript)!
return obj
}