Documentation ¶
Index ¶
- type Host
- type Linux
- func (c Linux) CheckPrivilege(h Host) error
- func (c Linux) CleanupEnvironment(h Host, env map[string]string) error
- func (c Linux) CleanupServiceEnvironment(h Host, s string) error
- func (c Linux) CommandExist(h Host, cmd string) bool
- func (c Linux) DaemonReload(h Host) error
- func (c Linux) DeleteFile(h Host, path string) error
- func (c Linux) DisableService(h Host, s string) error
- func (c Linux) EnableService(h Host, s string) error
- func (c Linux) FileExist(h Host, path string) bool
- func (c Linux) FixContainer(h Host) error
- func (c Linux) Hostname(h Host) string
- func (c Linux) InstallFile(h Host, src, dst, permissions string) error
- func (c Linux) IsContainer(h Host) bool
- func (c Linux) JoinPath(parts ...string) string
- func (c Linux) Kind() string
- func (c Linux) LineIntoFile(h Host, path, matcher, newLine string) error
- func (c Linux) LongHostname(h Host) string
- func (c Linux) Pwd(h Host) string
- func (c Linux) ReadFile(h Host, path string) (string, error)
- func (c Linux) Reboot(h Host) error
- func (c Linux) RestartService(h Host, s string) error
- func (c Linux) SELinuxEnabled(h Host) bool
- func (c Linux) ServiceIsRunning(h Host, s string) bool
- func (c Linux) ServiceScriptPath(h Host, s string) (string, error)
- func (c Linux) StartService(h Host, s string) error
- func (c Linux) StopService(h Host, s string) error
- func (c Linux) UpdateEnvironment(h Host, env map[string]string) error
- func (c Linux) UpdateServiceEnvironment(h Host, s string, env map[string]string) error
- func (c Linux) WriteFile(h Host, path string, data string, permissions string) error
- type Windows
- func (c Windows) CheckPrivilege(h Host) error
- func (c Windows) CleanupEnvironment(h Host, env map[string]string) error
- func (c Windows) CleanupServiceEnvironment(_ Host, _ string) error
- func (c Windows) CommandExist(h Host, cmd string) bool
- func (c Windows) DaemonReload(_ Host) error
- func (c Windows) DeleteFile(h Host, path string) error
- func (c Windows) DisableService(h Host, s string) error
- func (c Windows) EnableService(h Host, s string) error
- func (c Windows) FileExist(h Host, path string) bool
- func (c Windows) FixContainer(_ Host) error
- func (c Windows) Hostname(h Host) string
- func (c Windows) InstallFile(h Host, src, dst, _ string) error
- func (c Windows) InstallPackage(h Host, s ...string) error
- func (c Windows) IsContainer(_ Host) bool
- func (c Windows) JoinPath(parts ...string) string
- func (c Windows) Kind() string
- func (c Windows) LongHostname(h Host) string
- func (c Windows) Pwd(h Host) string
- func (c Windows) ReadFile(h Host, path string) (string, error)
- func (c Windows) Reboot(h Host) error
- func (c Windows) RestartService(h Host, s string) error
- func (c Windows) SELinuxEnabled(_ Host) bool
- func (c Windows) ServiceIsRunning(h Host, s string) bool
- func (c Windows) ServiceScriptPath(h Host, s string) (string, error)
- func (c Windows) StartService(h Host, s string) error
- func (c Windows) StopService(h Host, s string) error
- func (c Windows) UpdateEnvironment(h Host, env map[string]string) error
- func (c Windows) UpdateServiceEnvironment(_ Host, _ string, _ map[string]string) error
- func (c Windows) WriteFile(h Host, path string, data string, permissions string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Host ¶
type Host interface { Upload(source, destination string, opts ...exec.Option) error Exec(string, ...exec.Option) error ExecOutput(string, ...exec.Option) (string, error) Execf(string, ...interface{}) error ExecOutputf(string, ...interface{}) (string, error) String() string Sudo(string) (string, error) }
Host is an interface to a host object that has the functions needed by the various OS support packages
type Linux ¶
type Linux struct{}
Linux is a base module for various linux OS support packages
func (Linux) CheckPrivilege ¶
func (Linux) CleanupEnvironment ¶
CleanupEnvironment removes environment variable configuration
func (Linux) CleanupServiceEnvironment ¶ added in v0.3.24
CleanupServiceEnvironment updates environment variables for a service
func (Linux) CommandExist ¶
CommandExist returns true if the command exists
func (Linux) DaemonReload ¶
DaemonReload performs an init system config reload
func (Linux) DeleteFile ¶
DeleteFile deletes a file from the host.
func (Linux) DisableService ¶
DisableService disables a service on the host
func (Linux) EnableService ¶
EnableService enables a service on the host
func (Linux) FixContainer ¶
FixContainer makes a container work like a real host
func (Linux) InstallFile ¶ added in v0.4.0
func (Linux) IsContainer ¶
IsContainer returns true if the host is actually a container
func (Linux) LineIntoFile ¶
LineIntoFile tries to find a matching line in a file and replace it with a new entry TODO refactor this into go because it's too magical.
func (Linux) LongHostname ¶
LongHostname resolves the FQDN (long) hostname
func (Linux) RestartService ¶
RestartService restarts a service on the host
func (Linux) SELinuxEnabled ¶
SELinuxEnabled is true when SELinux is enabled
func (Linux) ServiceIsRunning ¶
ServiceIsRunning returns true if the service is running on the host
func (Linux) ServiceScriptPath ¶
ServiceScriptPath returns the service definition file path on the host
func (Linux) StartService ¶
StartService starts a service on the host
func (Linux) StopService ¶
StopService stops a service on the host
func (Linux) UpdateEnvironment ¶
UpdateEnvironment updates the hosts's environment variables
func (Linux) UpdateServiceEnvironment ¶ added in v0.3.24
UpdateServiceEnvironment updates environment variables for a service
type Windows ¶
type Windows struct{}
Windows is the base package for windows OS support
func (Windows) CheckPrivilege ¶
CheckPrivilege returns an error if the user does not have admin access to the host
func (Windows) CleanupEnvironment ¶
CleanupEnvironment removes environment variable configuration
func (Windows) CleanupServiceEnvironment ¶ added in v0.3.24
CleanupServiceEnvironment does nothing on windows
func (Windows) CommandExist ¶
CommandExist returns true if the provided command exists
func (Windows) DaemonReload ¶
DaemonReload reloads init system configuration
func (Windows) DeleteFile ¶
DeleteFile deletes a file from the host.
func (Windows) DisableService ¶
DisableService disables a a service
func (Windows) EnableService ¶
EnableService enables a a service
func (Windows) FixContainer ¶
FixContainer makes a container work like a real host (does nothing on windows for now)
func (Windows) InstallFile ¶ added in v0.4.0
func (Windows) InstallPackage ¶
InstallPackage enables an optional windows feature
func (Windows) IsContainer ¶
IsContainer returns true if the host is actually a container (always false on windows for now)
func (Windows) LongHostname ¶
LongHostname resolves the FQDN (long) hostname
func (Windows) RestartService ¶
RestartService restarts a a service
func (Windows) SELinuxEnabled ¶
SELinuxEnabled is true when SELinux is enabled (always false on windows for now)
func (Windows) ServiceIsRunning ¶
ServiceIsRunning returns true if a service is running
func (Windows) ServiceScriptPath ¶
ServiceScriptPath returns the path to a service configuration file
func (Windows) StartService ¶
StartService starts a a service
func (Windows) StopService ¶
StopService stops a a service
func (Windows) UpdateEnvironment ¶
UpdateEnvironment updates the hosts's environment variables
func (Windows) UpdateServiceEnvironment ¶ added in v0.3.24
UpdateServiceEnvironment does nothing on windows