WIP implement pass functs

This commit is contained in:
2024-08-14 19:43:39 +02:00
parent 6502bb1e12
commit 582c90c32a
2 changed files with 65 additions and 15 deletions

View File

@@ -100,16 +100,10 @@ func main() {
Config: Cfg,
}
Namespaces := make(map[string]*storage.Namespace)
for _, nsCfg := range Cfg {
ns1, err := storage.CreateNamespace(nsCfg.Id, storageHandler)
storageHandler.InitNamespaces()
if err != nil {
logger.Fatal(err)
}
Namespaces[nsCfg.Name] = ns1
defer ns1.Close()
for _, val := range storageHandler.Namespaces {
defer val.Close()
}
fmt.Printf(`
@@ -191,7 +185,7 @@ Commands:
case "list":
if len(fields) < 2 {
fmt.Printf("Available Namespaces:\n")
for k := range Namespaces {
for k := range storageHandler.Namespaces {
fmt.Printf("%s\n", k)
}
continue
@@ -201,7 +195,7 @@ Commands:
fmt.Printf("Listing content of %s", namespace)
val, ok := Namespaces[namespace]
val, ok := storageHandler.Namespaces[namespace]
if !ok {
fmt.Println("Namespace does not exist")
@@ -218,7 +212,7 @@ Commands:
namespace := fields[1]
val, ok := Namespaces[namespace]
val, ok := storageHandler.Namespaces[namespace]
if !ok {
fmt.Println("Namespace does not exist")
@@ -242,7 +236,7 @@ Commands:
namespace := fields[1]
val, ok := Namespaces[namespace]
val, ok := storageHandler.Namespaces[namespace]
if !ok {
fmt.Println("Namespace does not exist")
@@ -279,7 +273,7 @@ Commands:
namespace := fields[1]
val, ok := Namespaces[namespace]
val, ok := storageHandler.Namespaces[namespace]
if !ok {
fmt.Println("Namespace does not exist")