feat: Add heroscript serialization/deserialization functions
- Add heroscript_dumps and heroscript_loads functions - Replace paramsparser with encoderhero import - Add ulist_get and upload functions to docker installer - Add ulist_get and upload functions to zola installer
This commit is contained in:
@@ -23,3 +23,14 @@ fn obj_init(mycfg_ ZinitInstaller) !ZinitInstaller {
|
||||
fn configure() ! {
|
||||
// mut installer := get()!
|
||||
}
|
||||
|
||||
/////////////NORMALLY NO NEED TO TOUCH
|
||||
|
||||
pub fn heroscript_dumps(obj ZinitInstaller) !string {
|
||||
return encoderhero.encode[ZinitInstaller](obj)!
|
||||
}
|
||||
|
||||
pub fn heroscript_loads(heroscript string) !ZinitInstaller {
|
||||
mut obj := encoderhero.decode[ZinitInstaller](heroscript)!
|
||||
return obj
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
module fungistor
|
||||
|
||||
import incubaid.herolib.data.paramsparser
|
||||
import os
|
||||
import incubaid.herolib.data.encoderhero
|
||||
|
||||
pub const version = '0.0.0'
|
||||
const singleton = true
|
||||
@@ -25,3 +24,14 @@ fn obj_init(obj_ FungiStor) !FungiStor {
|
||||
fn configure() ! {
|
||||
// mut installer := get()!
|
||||
}
|
||||
|
||||
/////////////NORMALLY NO NEED TO TOUCH
|
||||
|
||||
pub fn heroscript_dumps(obj FungiStor) !string {
|
||||
return encoderhero.encode[FungiStor](obj)!
|
||||
}
|
||||
|
||||
pub fn heroscript_loads(heroscript string) !FungiStor {
|
||||
mut obj := encoderhero.decode[FungiStor](heroscript)!
|
||||
return obj
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
module grafana
|
||||
|
||||
import incubaid.herolib.data.paramsparser
|
||||
import os
|
||||
import incubaid.herolib.data.encoderhero
|
||||
|
||||
pub const version = '0.0.0'
|
||||
const singleton = true
|
||||
@@ -25,3 +24,14 @@ fn obj_init(obj_ Grafana) !Grafana {
|
||||
fn configure() ! {
|
||||
// mut installer := get()!
|
||||
}
|
||||
|
||||
/////////////NORMALLY NO NEED TO TOUCH
|
||||
|
||||
pub fn heroscript_dumps(obj Grafana) !string {
|
||||
return encoderhero.encode[Grafana](obj)!
|
||||
}
|
||||
|
||||
pub fn heroscript_loads(heroscript string) !Grafana {
|
||||
mut obj := encoderhero.decode[Grafana](heroscript)!
|
||||
return obj
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
module prometheus
|
||||
|
||||
import incubaid.herolib.data.paramsparser
|
||||
import os
|
||||
import incubaid.herolib.data.encoderhero
|
||||
|
||||
pub const version = '0.0.0'
|
||||
const singleton = true
|
||||
@@ -25,3 +24,14 @@ fn obj_init(obj_ Prometheus) !Prometheus {
|
||||
fn configure() ! {
|
||||
// mut installer := get()!
|
||||
}
|
||||
|
||||
/////////////NORMALLY NO NEED TO TOUCH
|
||||
|
||||
pub fn heroscript_dumps(obj Prometheus) !string {
|
||||
return encoderhero.encode[Prometheus](obj)!
|
||||
}
|
||||
|
||||
pub fn heroscript_loads(heroscript string) !Prometheus {
|
||||
mut obj := encoderhero.decode[Prometheus](heroscript)!
|
||||
return obj
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
module restic
|
||||
|
||||
import incubaid.herolib.data.paramsparser
|
||||
import os
|
||||
import incubaid.herolib.data.encoderhero
|
||||
|
||||
pub const version = '0.0.0'
|
||||
const singleton = true
|
||||
@@ -25,3 +24,14 @@ fn obj_init(obj_ Restic) !Restic {
|
||||
fn configure() ! {
|
||||
// mut installer := get()!
|
||||
}
|
||||
|
||||
/////////////NORMALLY NO NEED TO TOUCH
|
||||
|
||||
pub fn heroscript_dumps(obj Restic) !string {
|
||||
return encoderhero.encode[Restic](obj)!
|
||||
}
|
||||
|
||||
pub fn heroscript_loads(heroscript string) !Restic {
|
||||
mut obj := encoderhero.decode[Restic](heroscript)!
|
||||
return obj
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
module cloudhypervisor
|
||||
|
||||
import incubaid.herolib.data.paramsparser
|
||||
import os
|
||||
import incubaid.herolib.data.encoderhero
|
||||
|
||||
pub const version0 = '41.0'
|
||||
pub const version = '${version0}.0'
|
||||
@@ -24,3 +23,14 @@ fn obj_init(obj_ CloudHypervisor) !CloudHypervisor {
|
||||
fn configure() ! {
|
||||
// mut installer := get()!
|
||||
}
|
||||
|
||||
/////////////NORMALLY NO NEED TO TOUCH
|
||||
|
||||
pub fn heroscript_dumps(obj CloudHypervisor) !string {
|
||||
return encoderhero.encode[CloudHypervisor](obj)!
|
||||
}
|
||||
|
||||
pub fn heroscript_loads(heroscript string) !CloudHypervisor {
|
||||
mut obj := encoderhero.decode[CloudHypervisor](heroscript)!
|
||||
return obj
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
module docker
|
||||
|
||||
import incubaid.herolib.data.encoderhero
|
||||
|
||||
pub const version = '1.14.3'
|
||||
const singleton = false
|
||||
const default = true
|
||||
@@ -21,3 +23,14 @@ fn obj_init(obj_ DockerInstaller) !DockerInstaller {
|
||||
fn configure() ! {
|
||||
// mut installer := get()!
|
||||
}
|
||||
|
||||
/////////////NORMALLY NO NEED TO TOUCH
|
||||
|
||||
pub fn heroscript_dumps(obj DockerInstaller) !string {
|
||||
return encoderhero.encode[DockerInstaller](obj)!
|
||||
}
|
||||
|
||||
pub fn heroscript_loads(heroscript string) !DockerInstaller {
|
||||
mut obj := encoderhero.decode[DockerInstaller](heroscript)!
|
||||
return obj
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ module pacman
|
||||
import incubaid.herolib.osal.core as osal
|
||||
import incubaid.herolib.ui.console
|
||||
import incubaid.herolib.core
|
||||
import incubaid.herolib.installers.ulist
|
||||
import os
|
||||
|
||||
// checks if a certain version or above is installed
|
||||
@@ -17,6 +18,13 @@ fn installed() !bool {
|
||||
return true
|
||||
}
|
||||
|
||||
fn ulist_get() !ulist.UList {
|
||||
return ulist.UList{}
|
||||
}
|
||||
|
||||
fn upload() ! {
|
||||
}
|
||||
|
||||
// use https://archlinux.org/mirrorlist/
|
||||
|
||||
fn install() ! {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
module youki
|
||||
|
||||
import incubaid.herolib.data.paramsparser
|
||||
import os
|
||||
import incubaid.herolib.data.encoderhero
|
||||
|
||||
pub const version = '1.14.3'
|
||||
const singleton = true
|
||||
@@ -23,3 +22,14 @@ fn obj_init(obj_ YoukiInstaller) !YoukiInstaller {
|
||||
fn configure() ! {
|
||||
// mut installer := get()!
|
||||
}
|
||||
|
||||
/////////////NORMALLY NO NEED TO TOUCH
|
||||
|
||||
pub fn heroscript_dumps(obj YoukiInstaller) !string {
|
||||
return encoderhero.encode[YoukiInstaller](obj)!
|
||||
}
|
||||
|
||||
pub fn heroscript_loads(heroscript string) !YoukiInstaller {
|
||||
mut obj := encoderhero.decode[YoukiInstaller](heroscript)!
|
||||
return obj
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
module bun
|
||||
|
||||
import incubaid.herolib.data.paramsparser
|
||||
import os
|
||||
import incubaid.herolib.data.encoderhero
|
||||
|
||||
pub const version = '1.2.3'
|
||||
const singleton = true
|
||||
@@ -24,3 +23,14 @@ fn obj_init(obj_ Bun) !Bun {
|
||||
fn configure() ! {
|
||||
// mut installer := get()!
|
||||
}
|
||||
|
||||
/////////////NORMALLY NO NEED TO TOUCH
|
||||
|
||||
pub fn heroscript_dumps(obj Bun) !string {
|
||||
return encoderhero.encode[Bun](obj)!
|
||||
}
|
||||
|
||||
pub fn heroscript_loads(heroscript string) !Bun {
|
||||
mut obj := encoderhero.decode[Bun](heroscript)!
|
||||
return obj
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
module lighttpd
|
||||
|
||||
import incubaid.herolib.data.paramsparser
|
||||
import os
|
||||
import incubaid.herolib.data.encoderhero
|
||||
|
||||
pub const version = '0.0.0'
|
||||
const singleton = true
|
||||
@@ -25,3 +24,14 @@ fn obj_init(obj_ LightHttpdInstaller) !LightHttpdInstaller {
|
||||
fn configure() ! {
|
||||
// mut installer := get()!
|
||||
}
|
||||
|
||||
/////////////NORMALLY NO NEED TO TOUCH
|
||||
|
||||
pub fn heroscript_dumps(obj LightHttpdInstaller) !string {
|
||||
return encoderhero.encode[LightHttpdInstaller](obj)!
|
||||
}
|
||||
|
||||
pub fn heroscript_loads(heroscript string) !LightHttpdInstaller {
|
||||
mut obj := encoderhero.decode[LightHttpdInstaller](heroscript)!
|
||||
return obj
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import incubaid.herolib.core.texttools
|
||||
import incubaid.herolib.installers.base
|
||||
import incubaid.herolib.installers.lang.rust
|
||||
import incubaid.herolib.installers.web.tailwind
|
||||
import incubaid.herolib.installers.ulist
|
||||
import os
|
||||
|
||||
pub const version = '0.18.0'
|
||||
@@ -25,6 +26,13 @@ fn installed() !bool {
|
||||
return false
|
||||
}
|
||||
|
||||
fn ulist_get() !ulist.UList {
|
||||
return ulist.UList{}
|
||||
}
|
||||
|
||||
fn upload() ! {
|
||||
}
|
||||
|
||||
fn install() ! {
|
||||
console.print_header('install zola')
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
module zola
|
||||
|
||||
import incubaid.herolib.data.paramsparser
|
||||
import os
|
||||
import incubaid.herolib.data.encoderhero
|
||||
|
||||
const singleton = false
|
||||
const default = true
|
||||
@@ -23,3 +22,14 @@ fn obj_init(obj_ ZolaInstaller) !ZolaInstaller {
|
||||
fn configure() ! {
|
||||
// mut installer := get()!
|
||||
}
|
||||
|
||||
/////////////NORMALLY NO NEED TO TOUCH
|
||||
|
||||
pub fn heroscript_dumps(obj ZolaInstaller) !string {
|
||||
return encoderhero.encode[ZolaInstaller](obj)!
|
||||
}
|
||||
|
||||
pub fn heroscript_loads(heroscript string) !ZolaInstaller {
|
||||
mut obj := encoderhero.decode[ZolaInstaller](heroscript)!
|
||||
return obj
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user