the base
This commit is contained in:
@@ -19,4 +19,3 @@ fn (mut h HTTPConnection) header(req Request) Header {
|
||||
|
||||
return h.default_header.join(header)
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ module httpconnection
|
||||
import net.http
|
||||
import freeflowuniverse.herolib.clients.redisclient { RedisURL }
|
||||
|
||||
|
||||
@[params]
|
||||
pub struct HTTPConnectionArgs {
|
||||
pub:
|
||||
@@ -34,6 +33,4 @@ pub fn new(args HTTPConnectionArgs) !&HTTPConnection {
|
||||
base_url: args.url.trim('/')
|
||||
}
|
||||
return &conn
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ pub fn install(args_ InstallArgs) ! {
|
||||
if osal.is_linux() {
|
||||
osal.package_install('redis-server')!
|
||||
} else {
|
||||
osal.package_install('redis')!/Users/despiegk1/code/github/freeflowuniverse/herolib/herolib/installers/db/redis/template
|
||||
osal.package_install('redis')! / Users / despiegk1 / code / github / freeflowuniverse / herolib / herolib / installers / db / redis / template
|
||||
}
|
||||
}
|
||||
osal.execute_silent('mkdir -p ${args.datadir}')!
|
||||
|
||||
@@ -23,7 +23,6 @@ pub fn ensure_hero_dirs() string {
|
||||
return herodir()
|
||||
}
|
||||
|
||||
|
||||
// root dir for our hero environment
|
||||
pub fn herodir() string {
|
||||
return shell_expansion('~/hero')
|
||||
@@ -53,7 +52,6 @@ pub fn path_ensure(s string) string {
|
||||
return path
|
||||
}
|
||||
|
||||
|
||||
// get path underneath the hero root directory
|
||||
pub fn hero_path(s string) string {
|
||||
path := shell_expansion(s).trim_left(' /')
|
||||
@@ -61,7 +59,6 @@ pub fn hero_path(s string) string {
|
||||
return full_path
|
||||
}
|
||||
|
||||
|
||||
// return path and ensure it exists and return the path
|
||||
pub fn hero_path_ensure(s string) string {
|
||||
path := hero_path(s)
|
||||
|
||||
@@ -150,7 +150,7 @@ pub fn secret() !string {
|
||||
return secret
|
||||
}
|
||||
|
||||
pub fn client() !zdb.ZDB {
|
||||
pub fn client() !ZDB {
|
||||
mut db := zdb.get('localhost:3355', secret()!, 'test')!
|
||||
return db
|
||||
}
|
||||
|
||||
@@ -94,9 +94,9 @@ fn ulist_get() !ulist.UList {
|
||||
fn upload() ! {
|
||||
}
|
||||
|
||||
fn startupcmd() ![]zinit.ZProcessNewArgs {
|
||||
fn startupcmd() ![]ZProcessNewArgs {
|
||||
mut res := []zinit.ZProcessNewArgs{}
|
||||
res << zinit.ZProcessNewArgs{
|
||||
res << ZProcessNewArgs{
|
||||
name: 'zinit'
|
||||
cmd: '/usr/local/bin/zinit init'
|
||||
startuptype: .systemd
|
||||
|
||||
@@ -28,7 +28,7 @@ pub fn get(args_ ArgsGet) !&Zinit {
|
||||
//////////////////////////# LIVE CYCLE MANAGEMENT FOR INSTALLERS ///////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fn startupmanager_get(cat zinit.StartupManagerType) !startupmanager.StartupManager {
|
||||
fn startupmanager_get(cat StartupManagerType) !startupmanager.StartupManager {
|
||||
// unknown
|
||||
// screen
|
||||
// zinit
|
||||
|
||||
@@ -18,22 +18,16 @@ fn test_package_management() {
|
||||
assert !cmd_exists('wget')
|
||||
|
||||
// Update package list
|
||||
package_refresh() or {
|
||||
assert false, 'Failed to refresh package list: ${err}'
|
||||
}
|
||||
package_refresh() or { assert false, 'Failed to refresh package list: ${err}' }
|
||||
|
||||
// Install wget
|
||||
package_install('wget') or {
|
||||
assert false, 'Failed to install wget: ${err}'
|
||||
}
|
||||
package_install('wget') or { assert false, 'Failed to install wget: ${err}' }
|
||||
|
||||
// Verify wget is now installed
|
||||
assert cmd_exists('wget')
|
||||
|
||||
// Clean up - remove wget
|
||||
package_remove('wget') or {
|
||||
assert false, 'Failed to remove wget: ${err}'
|
||||
}
|
||||
package_remove('wget') or { assert false, 'Failed to remove wget: ${err}' }
|
||||
|
||||
// Verify wget is removed
|
||||
assert !cmd_exists('wget')
|
||||
|
||||
@@ -8,7 +8,7 @@ import json
|
||||
// client for telegram bot
|
||||
struct TelegramClient {
|
||||
bot vgram.Bot
|
||||
baobab client.Client // Baobab client
|
||||
baobab Client // Baobab client
|
||||
waiting_qs map[string]RedisQueue // where string is user_id
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user