Documentation
¶
Overview ¶
constants.go
finder.go
firewall_utils.go
launcher_utils.go
Package util provides utility functions for detecting headless systems. Description: Linux-specific utility functions for detecting headless systems.
system_utils.go
user_utils.go
Index ¶
- Variables
- func CheckFileExists(path string) bool
- func CheckHeadlessness() (bool, error)
- func CheckI2PIsInstalledDefaultLocation() (bool, error)
- func CheckI2PUserName() (string, error)
- func FindI2PIsInstalledDefaultLocation() (string, error)
- func GetFirewallPort() (string, error)
- func Home() string
- func Inithome(str string) string
- func IsHeadless() (bool, error)
- func UserFind() string
Constants ¶
This section is empty.
Variables ¶
var ( // I2CP_HOST is the i2cp host // Moved from: constant.go (non-platform-specific) I2CP_HOST string // I2CP_PORT is the i2cp port // Moved from: constant.go (non-platform-specific) I2CP_PORT string // WINDOWS_DEFAULT_LOCATION is the default location of the I2P router on Windows // Moved from: constant.go (non-platform-specific) WINDOWS_DEFAULT_LOCATION string = `C:\\Program Files\i2p\i2psvc.exe` // WINDOWS_ZERO_NSIS_DEFAULT_LOCATION is the default location of the I2P Zero router on Windows // Moved from: constant.go (non-platform-specific) WINDOWS_ZERO_NSIS_DEFAULT_LOCATION string = `C:\\Program Files\I2P-Zero\router\i2p-zero.exe` // I2PD_WINDOWS_DEFAULT_LOCATION is the default location of the I2Pd router on Windows // Moved from: constant.go (non-platform-specific) I2PD_WINDOWS_DEFAULT_LOCATION string = `C:\\Program Files\I2Pd\i2pd.exe` // LINUX_SYSTEM_LOCATION is the default location of the I2P router on Linux // Moved from: constant.go (non-platform-specific) LINUX_SYSTEM_LOCATION []string = []string{"/usr/bin/i2prouter", "/usr/sbin/i2prouter"} // I2PD_LINUX_SYSTEM_LOCATION is the default location of the I2Pd router on Linux // Moved from: constant.go (non-platform-specific) I2PD_LINUX_SYSTEM_LOCATION []string = []string{"/usr/sbin/i2pd", "/usr/bin/i2pd"} // I2P_ASUSER_HOME_LOCATION This is the path to the default I2P config directory when running as a user // Moved from: constant.go (non-platform-specific) I2P_ASUSER_HOME_LOCATION string = Inithome(Home()) // HOME_DIRECTORY_LOCATION can use config/run from a user's $HOME directory, this is the path to that router // Moved from: constant.go (non-platform-specific) HOME_DIRECTORY_LOCATION string = Inithome("/i2p/i2prouter") // OSX_DEFAULT_LOCATION is the default location of the I2P router on OSX // Moved from: constant.go (non-platform-specific) OSX_DEFAULT_LOCATION string = Inithome("/Library/Application Support/i2p/clients.config") )
Functions ¶
func CheckFileExists ¶
CheckFileExists checks to see if a file exists at the given path and returns a boolean value. It returns true if the file exists, false otherwise. Moved from: util.go (non-platform-specific)
func CheckHeadlessness ¶
CheckHeadlessness checks to see if the current environment is headless and returns a boolean value. it calls a platform-specific function in the background. it returns true if the system appears to be headless, false otherwise and any error encountered during detection. Moved from: util.go (non-platform-specific)
func CheckI2PIsInstalledDefaultLocation ¶
CheckI2PIsInstalledDefaultLocation looks in various locations for the presence of an I2P router.
func CheckI2PUserName ¶
CheckI2PUserName looks in various locations for the presence of an I2P router and guesses the username it should run under. On Windows it returns the EXE name.
func FindI2PIsInstalledDefaultLocation ¶
FindI2PIsInstalledDefaultLocation looks in various locations for the presence of an I2P router, reporting back the location
func GetFirewallPort ¶
GetFirewallPort finds the configured UDP port of your I2P router to help configure firewalls. It does this by finding the router.config and reading it. This function will not work on I2Pd routers yet but it should be easy to add support once I get some more time to test and research it.
func Home ¶
func Home() string
Home returns the path to the I2P(Java) home directory based on the current operating system. It returns a string containing the path to the I2P home directory. Moved from: util.go (non-platform-specific)
func Inithome ¶
Inithome returns the path to the user's home directory with the given string appended to the end. It panics if the user's home directory cannot be found. Moved from: util.go (non-platform-specific)
func IsHeadless ¶
IsHeadless determines if the current Linux system is running headless using multiple detection methods.
Types ¶
This section is empty.