initial commit

This commit is contained in:
ston1th 2020-11-22 12:59:12 +01:00
commit 7715fcf373
37 changed files with 2957 additions and 0 deletions

20
pkg/haproxy/systemd.go Normal file
View file

@ -0,0 +1,20 @@
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()
}