Add configuration and v1 server implementation; create handler methods for command execution and listing

This commit is contained in:
alex
2025-06-22 17:09:47 +03:00
parent c15e6c5b15
commit 27bda702bd
14 changed files with 10 additions and 8 deletions

View File

@@ -7,7 +7,7 @@ import (
"github.com/akyaiy/GoSally-mvp/internal/config" "github.com/akyaiy/GoSally-mvp/internal/config"
"github.com/akyaiy/GoSally-mvp/internal/logs" "github.com/akyaiy/GoSally-mvp/internal/logs"
"github.com/akyaiy/GoSally-mvp/internal/server/v1" "github.com/akyaiy/GoSally-mvp/internal/v1"
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
) )

View File

@@ -21,7 +21,7 @@ type HTTPServer struct {
} }
type ConfigEnv struct { type ConfigEnv struct {
ConfigPath string `env:"CONFIG_PATH" env-default:"./config/config.yaml"` ConfigPath string `env:"CONFIG_PATH" env-default:"./cfg/config.yaml"`
} }
func MustLoadConfig() *ConfigConf { func MustLoadConfig() *ConfigConf {

View File

@@ -1,4 +1,4 @@
module github.com/akyaiy/GoSally-mvp/internal/config module github.com/akyaiy/GoSally-mvp/config
go 1.24.4 go 1.24.4

View File

@@ -1,3 +0,0 @@
module github.com/akyaiy/GoSally-mvp/internal/logs
go 1.24.4

3
logs/go.mod Normal file
View File

@@ -0,0 +1,3 @@
module github.com/akyaiy/GoSally-mvp/logs
go 1.24.4

View File

@@ -1,9 +1,9 @@
module github.com/akyaiy/GoSally-mvp/internal/v1 module github.com/akyaiy/GoSally-mvp/v1
go 1.24.4 go 1.24.4
require ( require (
github.com/akyaiy/GoSally-mvp/internal/config v0.0.0-20250622085654-213db0b8c73b github.com/akyaiy/GoSally-mvp/internal/config v0.0.0-20250622140114-c15e6c5b1592
github.com/go-chi/chi/v5 v5.2.2 github.com/go-chi/chi/v5 v5.2.2
github.com/yuin/gopher-lua v1.1.1 github.com/yuin/gopher-lua v1.1.1
) )

View File

@@ -3,6 +3,8 @@ github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/akyaiy/GoSally-mvp/internal/config v0.0.0-20250622085654-213db0b8c73b h1:RTHso+pWhmwWLFVMCMt6ZZ5oGGh0jbOAlN8vBnD2G8o= github.com/akyaiy/GoSally-mvp/internal/config v0.0.0-20250622085654-213db0b8c73b h1:RTHso+pWhmwWLFVMCMt6ZZ5oGGh0jbOAlN8vBnD2G8o=
github.com/akyaiy/GoSally-mvp/internal/config v0.0.0-20250622085654-213db0b8c73b/go.mod h1:VCJJWOEkisTU5IBIuNVEc2ahosMRnoVy/I/Dnf79KVM= github.com/akyaiy/GoSally-mvp/internal/config v0.0.0-20250622085654-213db0b8c73b/go.mod h1:VCJJWOEkisTU5IBIuNVEc2ahosMRnoVy/I/Dnf79KVM=
github.com/akyaiy/GoSally-mvp/internal/config v0.0.0-20250622140114-c15e6c5b1592 h1:V5QzqnFoDnOVpjxMb0ZsBAX5jDaPE6OEiHxZ40/pqxM=
github.com/akyaiy/GoSally-mvp/internal/config v0.0.0-20250622140114-c15e6c5b1592/go.mod h1:VCJJWOEkisTU5IBIuNVEc2ahosMRnoVy/I/Dnf79KVM=
github.com/go-chi/chi/v5 v5.2.2 h1:CMwsvRVTbXVytCk1Wd72Zy1LAsAh9GxMmSNWLHCG618= github.com/go-chi/chi/v5 v5.2.2 h1:CMwsvRVTbXVytCk1Wd72Zy1LAsAh9GxMmSNWLHCG618=
github.com/go-chi/chi/v5 v5.2.2/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops= github.com/go-chi/chi/v5 v5.2.2/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops=
github.com/ilyakaznacheev/cleanenv v1.5.0 h1:0VNZXggJE2OYdXE87bfSSwGxeiGt9moSR2lOrsHHvr4= github.com/ilyakaznacheev/cleanenv v1.5.0 h1:0VNZXggJE2OYdXE87bfSSwGxeiGt9moSR2lOrsHHvr4=