moved config into proxy package

This commit is contained in:
Benson Wong
2024-10-04 09:38:30 -07:00
parent 7475bf0fff
commit d061819fb1
3 changed files with 4 additions and 7 deletions

View File

@@ -6,7 +6,6 @@ import (
"net/http" "net/http"
"os" "os"
"github.com/mostlygeek/go-llama-cpp-proxy/config"
"github.com/mostlygeek/go-llama-cpp-proxy/proxy" "github.com/mostlygeek/go-llama-cpp-proxy/proxy"
) )
@@ -17,7 +16,7 @@ func main() {
flag.Parse() // Parse the command-line flags flag.Parse() // Parse the command-line flags
config, err := config.LoadConfig(*configPath) config, err := proxy.LoadConfig(*configPath)
if err != nil { if err != nil {
fmt.Printf("Error loading config: %v\n", err) fmt.Printf("Error loading config: %v\n", err)
os.Exit(1) os.Exit(1)

View File

@@ -1,4 +1,4 @@
package config package proxy
import ( import (
"os" "os"

View File

@@ -13,20 +13,18 @@ import (
"sync" "sync"
"syscall" "syscall"
"time" "time"
"github.com/mostlygeek/go-llama-cpp-proxy/config"
) )
type ProxyManager struct { type ProxyManager struct {
sync.Mutex sync.Mutex
config *config.Config config *Config
currentCmd *exec.Cmd currentCmd *exec.Cmd
currentModel string currentModel string
currentProxy string currentProxy string
} }
func New(config *config.Config) *ProxyManager { func New(config *Config) *ProxyManager {
return &ProxyManager{config: config} return &ProxyManager{config: config}
} }