mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 20:52:33 +02:00
27 lines
603 B
Go
27 lines
603 B
Go
package agent
|
|
|
|
import (
|
|
"bytes"
|
|
"text/template"
|
|
|
|
_ "embed"
|
|
)
|
|
|
|
var (
|
|
//go:embed templates/agent.compose.yml
|
|
agentComposeYAML string
|
|
agentComposeYAMLTemplate = template.Must(template.New("agent.compose.yml").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))
|
|
if err := agentComposeYAMLTemplate.Execute(buf, c); err != nil {
|
|
return "", err
|
|
}
|
|
return buf.String(), nil
|
|
}
|