This commit is contained in:
2025-05-24 06:56:02 +04:00
parent 55a05a5571
commit b8c8da9e31
11 changed files with 517 additions and 119 deletions

View File

@@ -0,0 +1,63 @@
package heroagent
import (
"git.ourworld.tf/herocode/heroagent/pkg/servers/ui"
"git.ourworld.tf/herocode/heroagent/pkg/servers/webdavserver"
)
// Config holds the configuration for the HeroAgent server factory
type Config struct {
// Redis server configuration
Redis RedisConfig
// WebDAV server configuration
WebDAV WebDAVConfig
// UI server configuration
UI UIConfig
// Enable/disable specific servers
EnableRedis bool
EnableWebDAV bool
EnableUI bool
}
// RedisConfig holds the configuration for the Redis server
type RedisConfig struct {
TCPPort int
UnixSocketPath string
}
// WebDAVConfig holds the configuration for the WebDAV server
type WebDAVConfig struct {
// Use webdavserver.Config directly
Config webdavserver.Config
}
// UIConfig holds the configuration for the UI server
type UIConfig struct {
// UI server configuration
Port string
// Any additional UI-specific configuration
AppConfig ui.AppConfig
}
// DefaultConfig returns the default configuration for the HeroAgent
func DefaultConfig() Config {
return Config{
Redis: RedisConfig{
TCPPort: 6378,
UnixSocketPath: "/tmp/redis.sock",
},
WebDAV: WebDAVConfig{
Config: webdavserver.DefaultConfig(),
},
UI: UIConfig{
Port: "9001", // Port is a string in UIConfig
AppConfig: ui.AppConfig{},
},
EnableRedis: true,
EnableWebDAV: true,
EnableUI: true,
}
}