refactoring: full refactoring the database structure from 1 file to 2 file db struct to avoid conflict 2 writters and sqllite busy, improve tests
Some checks failed
build / build (push) Has been cancelled

This commit is contained in:
d3m0k1d
2026-01-22 20:29:19 +03:00
parent 9a7e5a4796
commit 5f607d0be0
13 changed files with 989 additions and 364 deletions

View File

@@ -82,23 +82,11 @@ var InitCmd = &cobra.Command{
}
fmt.Println("Firewall configured")
db, err := storage.NewDB()
err = storage.CreateTables()
if err != nil {
fmt.Println(err)
os.Exit(1)
}
err = db.CreateTable()
if err != nil {
fmt.Println(err)
os.Exit(1)
}
defer func() {
err = db.Close()
if err != nil {
fmt.Println(err)
os.Exit(1)
}
}()
fmt.Println("Firewall detected and configured")
fmt.Println("BanForge initialized successfully!")