Documentation
¶
Overview ¶
Package os is for running commands on a remote host
Index ¶
- Constants
- type Configurer
- type HostValidator
- type Linux
- func (l *Linux) Arch(h os.Host) (string, error)
- func (l *Linux) Base(p string) string
- func (l *Linux) CTLLockFilePath(h os.Host) string
- func (l *Linux) Chown(h os.Host, path, owner string, opts ...exec.Option) error
- func (l *Linux) DeleteDir(h os.Host, path string, opts ...exec.Option) error
- func (l *Linux) Dir(p string) string
- func (l *Linux) DownloadURL(h os.Host, url, destination string, opts ...exec.Option) error
- func (l *Linux) FileContains(h os.Host, path, s string) bool
- func (l *Linux) GetDistroService(key string) (string, error)
- func (l *Linux) GetSysctlValue(h os.Host, key string) (string, error)
- func (l *Linux) HTTPStatus(h os.Host, url string) (int, error)
- func (l *Linux) HostPath(p string) string
- func (l *Linux) LookPath(h os.Host, file string) (string, error)
- func (l *Linux) MoveFile(h os.Host, src, dst string) error
- func (l *Linux) OSKind() string
- func (l *Linux) PrivateAddress(h os.Host, iface, publicip string) (string, error)
- func (l *Linux) PrivateInterface(h os.Host) (string, error)
- func (l *Linux) Quote(value string) string
- func (l *Linux) SetPath(key, value string)
- func (l *Linux) SetSysctlValue(h os.Host, key string, value string) error
- func (l *Linux) SystemTime(h os.Host) (time.Time, error)
- func (l *Linux) TempDir(h os.Host) (string, error)
- func (l *Linux) TempFile(h os.Host) (string, error)
- func (l *Linux) UpsertFile(h os.Host, path, content string) error
Constants ¶
const ( // BinaryPath key for the binary path for the distro engine BinaryPath = "BinaryPath" // ConfigPath key for the config directory for the distro engine ConfigPath = "ConfigPath" // JoinTokenPath key for the join token for the cluster JoinTokenPath = "JoinTokenPath" // DataDirDefaultPath key for the data directory for the distro engine DataDirDefaultPath = "DataDirDefaultPath" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configurer ¶
type Configurer interface {
//keep-sorted start
Arch(os.Host) (string, error)
Base(string) string
CTLLockFilePath(h os.Host) string
CheckPrivilege(os.Host) error
Chmod(os.Host, string, string, ...exec.Option) error
Chown(os.Host, string, string, ...exec.Option) error
CleanupServiceEnvironment(os.Host, string) error
CommandExist(os.Host, string) bool
DaemonReload(os.Host) error
DeleteDir(os.Host, string, ...exec.Option) error
DeleteFile(os.Host, string) error
Dir(string) string
DownloadURL(os.Host, string, string, ...exec.Option) error
EnableService(os.Host, string) error
FileContains(os.Host, string, string) bool
FileExist(os.Host, string) bool
GetDistroService(string) (string, error)
GetSysctlValue(os.Host, string) (string, error)
HTTPStatus(os.Host, string) (int, error)
HostPath(string) string
Hostname(os.Host) string
InstallPackage(os.Host, ...string) error
Kind() string
LongHostname(os.Host) string
LookPath(os.Host, string) (string, error)
MkDir(os.Host, string, ...exec.Option) error
MoveFile(os.Host, string, string) error
OSKind() string
PrivateAddress(os.Host, string, string) (string, error)
PrivateInterface(os.Host) (string, error)
Quote(string) string
ReadFile(os.Host, string) (string, error)
RestartService(os.Host, string) error
SELinuxEnabled(os.Host) bool
ServiceIsRunning(os.Host, string) bool
ServiceScriptPath(os.Host, string) (string, error)
SetPath(string, string)
SetSysctlValue(os.Host, string, string) error
Sha256sum(h os.Host, path string, opts ...exec.Option) (string, error)
StartService(os.Host, string) error
Stat(os.Host, string, ...exec.Option) (*os.FileInfo, error)
StopService(os.Host, string) error
SystemTime(os.Host) (time.Time, error)
TempDir(os.Host) (string, error)
TempFile(os.Host) (string, error)
Touch(os.Host, string, time.Time, ...exec.Option) error
UninstallPackage(os.Host, ...string) error
UpdateEnvironment(os.Host, map[string]string) error
UpdateServiceEnvironment(os.Host, string, map[string]string) error
UpsertFile(os.Host, string, string) error
WriteFile(os.Host, string, string, string) error
}
Configurer defines the per-host operations required for managing a host.
type HostValidator ¶
HostValidator allows a Configurer to implement host-specific validation logic.
type Linux ¶
type Linux struct {
// contains filtered or unexported fields
}
Linux is a base module for various linux OS support packages
func (*Linux) CTLLockFilePath ¶
CTLLockFilePath returns a path to a lock file
func (*Linux) DownloadURL ¶
DownloadURL performs a download from a URL on the host
func (*Linux) FileContains ¶
FileContains returns true if a file contains the substring
func (*Linux) GetDistroService ¶
GetDistroService returns the name of the service for the current distro. common key values are, "controller" and "agent"
func (*Linux) GetSysctlValue ¶
GetSysctlValue get the current value of a sysctl value, will return an error if the key does not exist
func (*Linux) HTTPStatus ¶
HTTPStatus makes a HTTP GET request to the url and returns the status code or an error
func (*Linux) LookPath ¶
LookPath behaves similarly to exec.LookPath but resolves the binary on the remote host
func (*Linux) PrivateAddress ¶
PrivateAddress resolves internal ip from private interface
func (*Linux) PrivateInterface ¶
PrivateInterface tries to find a private network interface
func (*Linux) SetPath ¶
SetPath adds a key value to the paths string map. TODO add ref to what the paths string map does....
func (*Linux) SetSysctlValue ¶
SetSysctlValue sets the sysctl key with the given value, will return if any errors are set
func (*Linux) SystemTime ¶
SystemTime returns the system time as UTC reported by the OS or an error if this fails
Directories
¶
| Path | Synopsis |
|---|---|
|
Package linux is implementing the interface github.com/colonel-byte/cargoship/src/types/os.Configurer for Linux based hosts
|
Package linux is implementing the interface github.com/colonel-byte/cargoship/src/types/os.Configurer for Linux based hosts |
|
enterpriselinux
Package enterpriselinux is implementing the interface github.com/colonel-byte/cargoship/src/types/os.Configurer for Enterprise Linux hosts
|
Package enterpriselinux is implementing the interface github.com/colonel-byte/cargoship/src/types/os.Configurer for Enterprise Linux hosts |