Refactor and restructure core components

- Removed obsolete files: `hanle_multi.go`, `logger.go`, `handle_com.go`, `handle_list.go`, `server.go`, and `utils.go` from the `general_server` and `sv1` packages.
- Introduced new implementations for the `GeneralServer` and `HandlerV1` in the `core` package, enhancing the overall architecture.
- Updated the `go.mod` and `go.sum` files to include new dependencies.
- Added a new configuration structure in `config.yaml` and `config.go` for better management of application settings.
- Implemented a Lua command handling mechanism in `handle_com.go` and `handle_list.go` for improved command execution.
- Enhanced logging capabilities with a new logger setup in `logger.go`.
- Added a new Lua script `http.lua` for handling HTTP requests.
This commit is contained in:
alex
2025-06-26 16:50:35 +03:00
parent 9f7f046a07
commit 96fb13e3c7
15 changed files with 214 additions and 145 deletions

View File

@@ -5,10 +5,10 @@ import (
"net/http"
"regexp"
"github.com/akyaiy/GoSally-mvp/config"
gs "github.com/akyaiy/GoSally-mvp/general_server"
"github.com/akyaiy/GoSally-mvp/logs"
"github.com/akyaiy/GoSally-mvp/sv1"
"github.com/akyaiy/GoSally-mvp/core/config"
gs "github.com/akyaiy/GoSally-mvp/core/general_server"
"github.com/akyaiy/GoSally-mvp/core/logs"
"github.com/akyaiy/GoSally-mvp/core/sv1"
"github.com/go-chi/chi/v5"
)
@@ -38,6 +38,7 @@ func main() {
Log: *logs.SetupLogger(cfg.Mode),
Config: cfg,
}, serverv1)
r := chi.NewRouter()
r.Route("/api/{ver}/com", func(r chi.Router) {
r.Get("/", s.HandleList)