haproxy-lb/pkg/haproxy/systemd.go
2020-11-22 12:59:12 +01:00

20 lines
359 B
Go

package haproxy
import (
"context"
"os/exec"
)
const systemctl = "systemctl"
type SystemdManager struct {
service string
}
func NewSystemdManager(service string) *SystemdManager {
return &SystemdManager{service}
}
func (sm *SystemdManager) Reload(ctx context.Context) error {
return exec.CommandContext(ctx, systemctl, "reload", sm.service).Run()
}