nix-amer/internal/ser/common.go

19 lines
551 B
Go
Raw Normal View History

package ser
import (
2018-11-13 12:10:55 +00:00
"github.com/xdrm-brackets/nix-amer/internal/exec"
)
2018-11-11 18:01:00 +00:00
// DefaultManager if not empty is the default service-manager to use when missing
var DefaultManager = "systemd"
// ServiceManager is the common interface for service managers (systemd, init.d)
type ServiceManager interface {
// SetExecContext sets the execution context, default is os/exec
SetExecutor(exec.Executor)
// Name of executable (to check if installed and for debug)
Name() string
// Exec a specific action on a service
Exec(action, service string) error
}