fix
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
module zdb
|
||||
|
||||
import freeflowuniverse.herolib.clients.redisclient
|
||||
import freeflowuniverse.herolib.core.redisclient
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
|
||||
pub struct ZDB {
|
||||
|
||||
@@ -34,15 +34,16 @@ pub enum Cat {
|
||||
|
||||
pub fn gen_model_set(args GenerateArgs) ! {
|
||||
model := args.model
|
||||
heroscript_templ := $tmpl('templates/heroscript')
|
||||
|
||||
//TODO: look in lib/code/generator/installer_client/templates/heroscript, don't use the if in template, use 2 templates, depending type use other template, and the args used should be set here in code
|
||||
|
||||
mut heroscript_templ := match model.cat {
|
||||
.client { heroscript_templ := $tmpl('templates/heroscript_client' )}
|
||||
.installer { heroscript_templ := $tmpl('templates/heroscript_installer' )}
|
||||
else { return error('Invalid category: ${model.cat}') }
|
||||
}
|
||||
pathlib.template_write(heroscript_templ, '${args.path}/.heroscript', true)!
|
||||
}
|
||||
|
||||
|
||||
pub fn gen_model_get(path string, create: bool) !GenModel {
|
||||
pub fn gen_model_get(path string, create bool) !GenModel {
|
||||
console.print_debug('play installer code for path: ${path}')
|
||||
|
||||
mut config_path := pathlib.get_file(path: '${path}/.heroscript', create: create)!
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
!!hero_code.generate_${if model.cat == .installer { "installer" } else { "client" }}
|
||||
name:"${model.name}"
|
||||
classname:"${model.classname}"
|
||||
config:${if model.hasconfig { "1" } else { "0" }}
|
||||
singleton:${if model.singleton { "1" } else { "0" }}
|
||||
default:${if model.default { "1" } else { "0" }}
|
||||
title:\"${model.title}\"
|
||||
${if model.cat == .installer {
|
||||
templates:${if model.templates { "1" } else { "0" }}
|
||||
build:${if model.build { "1" } else { "0" }}
|
||||
startupmanager:${if model.startupmanager { "1" } else { "0" }}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
!!hero_code.generate_client
|
||||
name: "${model.name}"
|
||||
classname: "${model.classname}"
|
||||
config: ${model.hasconfig}
|
||||
singleton: ${model.singleton}
|
||||
default: ${model.default}
|
||||
title: "${model.title}|
|
||||
@@ -0,0 +1,11 @@
|
||||
!!hero_code.generate_installer
|
||||
name: "${model.name}"
|
||||
classname: "${model.classname}"
|
||||
config: ${model.hasconfig}
|
||||
singleton: ${model.singleton}
|
||||
default: ${model.default}
|
||||
title: "${model.title}"
|
||||
templates: ${model.templates}
|
||||
build: ${model.build}
|
||||
startupmanager: ${model.startupmanager}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module base
|
||||
|
||||
import freeflowuniverse.herolib.data.paramsparser
|
||||
import freeflowuniverse.herolib.clients.redisclient
|
||||
import freeflowuniverse.herolib.core.redisclient
|
||||
import freeflowuniverse.herolib.data.dbfs
|
||||
// import freeflowuniverse.herolib.crypt.secp256k1
|
||||
import freeflowuniverse.herolib.crypt.aes_symmetric
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module httpconnection
|
||||
|
||||
import net.http { Header }
|
||||
import freeflowuniverse.herolib.clients.redisclient { Redis }
|
||||
import freeflowuniverse.herolib.core.redisclient { Redis }
|
||||
|
||||
@[heap]
|
||||
pub struct HTTPConnection {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module httpconnection
|
||||
|
||||
import net.http
|
||||
import freeflowuniverse.herolib.clients.redisclient { RedisURL }
|
||||
import freeflowuniverse.herolib.core.redisclient { RedisURL }
|
||||
|
||||
@[params]
|
||||
pub struct HTTPConnectionArgs {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
```v
|
||||
|
||||
import freeflowuniverse.herolib.clients.redisclient
|
||||
import freeflowuniverse.herolib.core.redisclient
|
||||
|
||||
mut redis := redisclient.core_get()!
|
||||
redis.set('test', 'some data') or { panic('set' + err.str() + '\n' + c.str()) }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import freeflowuniverse.herolib.clients.redisclient
|
||||
import freeflowuniverse.herolib.core.redisclient
|
||||
|
||||
fn setup() !&redisclient.Redis {
|
||||
mut redis := redisclient.core_get()!
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import freeflowuniverse.herolib.clients.redisclient
|
||||
import freeflowuniverse.herolib.core.redisclient
|
||||
import time
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
// original code see https://github.com/patrickpissurno/vredis/blob/master/vredis_test.v
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import freeflowuniverse.herolib.clients.redisclient
|
||||
import freeflowuniverse.herolib.core.redisclient
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
|
||||
fn setup() !&redisclient.Redis {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module smartid
|
||||
|
||||
// import freeflowuniverse.herolib.clients.redisclient
|
||||
// import freeflowuniverse.herolib.core.redisclient
|
||||
import math
|
||||
// import freeflowuniverse.herolib.core.texttools.regext
|
||||
// import rand
|
||||
|
||||
@@ -2,7 +2,7 @@ module dbfs
|
||||
|
||||
import freeflowuniverse.herolib.core.pathlib
|
||||
import freeflowuniverse.herolib.core.texttools
|
||||
// import freeflowuniverse.herolib.clients.redisclient
|
||||
// import freeflowuniverse.herolib.core.redisclient
|
||||
import os
|
||||
import json
|
||||
// import freeflowuniverse.herolib.ui.console
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module dbfs
|
||||
|
||||
import freeflowuniverse.herolib.core.pathlib
|
||||
// import freeflowuniverse.herolib.clients.redisclient
|
||||
// import freeflowuniverse.herolib.core.redisclient
|
||||
import os
|
||||
|
||||
@[params]
|
||||
|
||||
@@ -2,7 +2,7 @@ module gittools
|
||||
|
||||
import crypto.md5
|
||||
import freeflowuniverse.herolib.core.pathlib
|
||||
import freeflowuniverse.herolib.clients.redisclient
|
||||
import freeflowuniverse.herolib.core.redisclient
|
||||
import os
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import freeflowuniverse.herolib.ui as gui
|
||||
import freeflowuniverse.herolib.core.pathlib
|
||||
import freeflowuniverse.herolib.ui.console
|
||||
import freeflowuniverse.herolib.ui.generic
|
||||
import freeflowuniverse.herolib.clients.redisclient
|
||||
import freeflowuniverse.herolib.core.redisclient
|
||||
import os
|
||||
|
||||
pub const gitcmds = 'clone,commit,pull,push,delete,reload,list,edit,sourcetree,cd'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module gittools
|
||||
|
||||
import freeflowuniverse.herolib.clients.redisclient
|
||||
import freeflowuniverse.herolib.core.redisclient
|
||||
import time
|
||||
|
||||
// ReposGetArgs defines arguments to retrieve repositories from the git structure.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module gittools
|
||||
|
||||
import json
|
||||
import freeflowuniverse.herolib.clients.redisclient
|
||||
import freeflowuniverse.herolib.core.redisclient
|
||||
|
||||
fn redis_get() redisclient.Redis {
|
||||
mut redis_client := redisclient.core_get() or { panic(err) }
|
||||
|
||||
@@ -44,7 +44,7 @@ Display the recorded timeline:
|
||||
## Dependencies
|
||||
|
||||
• Redis: Requires a Redis server for data storage.
|
||||
• Redis Client: Uses freeflowuniverse.herolib.clients.redisclient.
|
||||
• Redis Client: Uses freeflowuniverse.herolib.core.redisclient.
|
||||
|
||||
## Example
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@ import arrays
|
||||
import time
|
||||
import sync
|
||||
import term // For color coding
|
||||
import freeflowuniverse.herolib.clients.redisclient
|
||||
import freeflowuniverse.herolib.core.redisclient
|
||||
|
||||
// Struct to represent a timer for measuring process performance
|
||||
@[noinit]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module client
|
||||
|
||||
import freeflowuniverse.herolib.baobab.client
|
||||
import freeflowuniverse.herolib.clients.redisclient
|
||||
import freeflowuniverse.herolib.core.redisclient
|
||||
import dariotarantini.vgram
|
||||
import json
|
||||
|
||||
|
||||
Reference in New Issue
Block a user