mirror of
https://github.com/yusing/godoxy.git
synced 2026-01-19 00:27:02 +01:00
- Introduced ContainerRuntime field in AgentConfig and AgentEnvConfig. - Added IterAgents and NumAgents functions for agent pool management. - Updated agent creation and verification endpoints to handle container runtime. - Enhanced Docker Compose template to support different container runtimes. - Added runtime endpoint to retrieve agent runtime information.
29 lines
613 B
Go
29 lines
613 B
Go
package agent
|
|
|
|
import (
|
|
"bytes"
|
|
"text/template"
|
|
|
|
_ "embed"
|
|
)
|
|
|
|
var (
|
|
//go:embed templates/agent.compose.yml.tmpl
|
|
agentComposeYAML string
|
|
agentComposeYAMLTemplate = template.Must(template.New("agent.compose.yml.tmpl").Parse(agentComposeYAML))
|
|
)
|
|
|
|
const (
|
|
DockerImageProduction = "ghcr.io/yusing/godoxy-agent:latest"
|
|
DockerImageNightly = "ghcr.io/yusing/godoxy-agent:nightly"
|
|
)
|
|
|
|
func (c *AgentComposeConfig) Generate() (string, error) {
|
|
buf := bytes.NewBuffer(make([]byte, 0, 1024))
|
|
err := agentComposeYAMLTemplate.Execute(buf, c)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return buf.String(), nil
|
|
}
|