Documentation
¶
Overview ¶
Package platform provides OS-specific abstractions for cross-platform support.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecutableExtension ¶
func ExecutableExtension() string
ExecutableExtension returns the executable file extension for the current platform.
func HomeDirEnv ¶
func HomeDirEnv() string
HomeDirEnv returns the environment variable name for the home directory.
func PathSeparator ¶
func PathSeparator() string
PathSeparator returns the path separator for the current platform.
Types ¶
type DialogResult ¶
type DialogResult int
DialogResult represents the result of a dialog interaction.
const ( DialogResultCancel DialogResult = iota DialogResultUpdate DialogResultRemindLater DialogResultViewDetails )
type Platform ¶
type Platform interface {
// Identity
ID() ID
Architecture() string
Name() string
// Paths
GetDataDir() string
GetConfigDir() string
GetCacheDir() string
GetLogDir() string
GetIPCSocketPath() string
// Auto-start
EnableAutoStart(ctx context.Context) error
DisableAutoStart(ctx context.Context) error
IsAutoStartEnabled(ctx context.Context) (bool, error)
// Executables
FindExecutable(name string) (string, error)
FindExecutables(name string) ([]string, error)
IsExecutableInPath(name string) bool
GetPathDirs() []string
// Commands
GetShell() string
GetShellArg() string
// Notifications
ShowNotification(title, message string) error
// Dialogs
ShowChangelogDialog(agentName, fromVer, toVer, changelog string) DialogResult
}
Platform abstracts OS-specific operations.
Click to show internal directories.
Click to hide internal directories.