Documentation
¶
Index ¶
- func Start(sys System, logFile string) error
- func Status(sys System) (string, error)
- func Stop(sys System) error
- type RealSystem
- func (RealSystem) Executable() (string, error)
- func (RealSystem) MkdirAll(path string, perm os.FileMode) error
- func (RealSystem) RemoveFile(name string) error
- func (RealSystem) RunCommand(name string, args ...string) ([]byte, error)
- func (RealSystem) Stat(name string) (os.FileInfo, error)
- func (RealSystem) UserHomeDir() (string, error)
- func (RealSystem) WriteFile(name string, data []byte, perm os.FileMode) error
- type System
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Start ¶
Start writes a systemd user unit file and enables the service. logFile is the absolute path to the daemon log file.
Types ¶
type RealSystem ¶
type RealSystem struct{}
RealSystem implements System with real OS calls.
func (RealSystem) Executable ¶
func (RealSystem) Executable() (string, error)
func (RealSystem) RemoveFile ¶
func (RealSystem) RemoveFile(name string) error
func (RealSystem) RunCommand ¶
func (RealSystem) RunCommand(name string, args ...string) ([]byte, error)
func (RealSystem) UserHomeDir ¶
func (RealSystem) UserHomeDir() (string, error)
type System ¶
type System interface {
Executable() (string, error)
UserHomeDir() (string, error)
MkdirAll(path string, perm os.FileMode) error
WriteFile(name string, data []byte, perm os.FileMode) error
RemoveFile(name string) error
RunCommand(name string, args ...string) ([]byte, error)
Stat(name string) (os.FileInfo, error)
}
System abstracts OS operations for testability.
Click to show internal directories.
Click to hide internal directories.