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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user