Documentation
¶
Index ¶
- Constants
- func GetCommandPrefix() string
- func Install(name string) (err error)
- func IsInstalled(name string) error
- func Register(name string, starter Starter)
- func ServiceAction(state ServiceState, serviceName string) (err error)
- func SetCommandPrefix(prefix string)
- func WriteFile(location string, body []byte) (err error)
- type ServiceState
- type SimpleInstall
- type Starter
- type StarterItem
Constants ¶
View Source
const ( ServiceStop ServiceState = "stop" ServiceStart = "start" ServiceRestart = "restart" ServiceStatus = "status" )
Variables ¶
This section is empty.
Functions ¶
func Register ¶
Register makes a starter available by the provided name. If Register is called twice with the same name or if starter is nil, it panics.
func ServiceAction ¶
func ServiceAction(state ServiceState, serviceName string) (err error)
ServiceAction run action for service systemctl <action> <service-name> Example : systemctl restart ssh
func SetCommandPrefix ¶
func SetCommandPrefix(prefix string)
SetCommandPrefix - add prefix before each command. Typically used for ssh, docker, ... Example for ssh prefix is `ssh some@localhost`
Types ¶
type SimpleInstall ¶
type SimpleInstall struct {
ProgramName string // Name of program
}
SimpleInstall - base type for program just install
func (SimpleInstall) Run ¶
func (s SimpleInstall) Run() (err error)
Run - install program without any other settings
type StarterItem ¶
func List ¶
func List() []StarterItem
List returns a sorted list of the names of the registered starters.
Click to show internal directories.
Click to hide internal directories.