Documentation ¶
Index ¶
- Variables
- func AfterUpdateApply(context Context, willRestart bool, force bool, log Log) error
- func AppBundleForPath() (string, error)
- func AutoInstall(context Context, binPath string, force bool, log Log) (newProc bool, err error)
- func AutoInstallWithStatus(context Context, binPath string, force bool, log Log) keybase1.InstallResult
- func BinPath() (string, error)
- func CheckIfValidLocation() *keybase1.Error
- func DefaultKBFSLabel(runMode libkb.RunMode) string
- func DefaultLaunchdEnvVars(label string) []launchd.EnvVar
- func DefaultServiceLabel(runMode libkb.RunMode) string
- func DefaultUpdaterLabel(runMode libkb.RunMode) string
- func Install(context Context, binPath string, components []string, force bool, log Log) keybase1.InstallResult
- func IsInUse(mountDir string, log Log) bool
- func KBFS(context Context, binPath string, force bool, log Log) error
- func KBFSBinPath(runMode libkb.RunMode, binPath string) (string, error)
- func KBFSBundleVersion(context Context, binPath string) (string, error)
- func KBFSServiceStatus(context Context, label string, wait time.Duration, log Log) (status keybase1.ServiceStatus)
- func KeybaseFuseStatus(bundleVersion string, log Log) keybase1.FuseStatus
- func KeybaseFuseStatusForAppBundle(appPath string, log Log) (keybase1.FuseStatus, error)
- func KeybaseServiceStatus(context Context, label string, wait time.Duration, log Log) (status keybase1.ServiceStatus)
- func ListServices(context Context, wait time.Duration, log Log) (*keybase1.ServicesStatus, error)
- func OSVersion() (semver.Version, error)
- func ResolveInstallStatus(version string, bundleVersion string, lastExitStatus string, log Log) (installStatus keybase1.InstallStatus, installAction keybase1.InstallAction, ...)
- func RunAfterStartup(context Context, isService bool, log Log)
- func RunApp(context Context, log Log) error
- func ServiceStatus(context Context, label ServiceLabel, wait time.Duration, log Log) (*keybase1.ServiceStatus, error)
- func TerminateApp(context Context, log Log) error
- func Uninstall(context Context, components []string, log Log) keybase1.UninstallResult
- func UninstallKBFS(runMode libkb.RunMode, mountDir string, forceUnmount bool, log Log) error
- func UpdaterBinPath() (string, error)
- func UpdaterServiceStatus(context Context, label string) keybase1.ServiceStatus
- type ComponentName
- type Context
- type Log
- type ServiceLabel
Constants ¶
This section is empty.
Variables ¶
var ComponentNames = []ComponentName{ComponentNameCLI, ComponentNameService, ComponentNameKBFS, ComponentNameUpdater}
ComponentNames are all the valid component names
Functions ¶
func AfterUpdateApply ¶ added in v1.0.17
AfterUpdateApply runs after an update has been applied
func AppBundleForPath ¶ added in v1.0.17
AppBundleForPath returns path to app bundle
func AutoInstall ¶
AutoInstall runs the auto install
func AutoInstallWithStatus ¶
func AutoInstallWithStatus(context Context, binPath string, force bool, log Log) keybase1.InstallResult
AutoInstallWithStatus runs the auto install and returns a result
func CheckIfValidLocation ¶
func CheckIfValidLocation() *keybase1.Error
CheckIfValidLocation checks if the current environment is running from a valid location. For example, this will return an error if this isn't running from /Applications/Keybase.app on MacOS.
func DefaultKBFSLabel ¶
DefaultKBFSLabel returns the default label for KBFS service in launchd
func DefaultLaunchdEnvVars ¶
DefaultLaunchdEnvVars returns default environment vars for launchd
func DefaultServiceLabel ¶
DefaultServiceLabel returns the default label for Keybase service in launchd
func DefaultUpdaterLabel ¶ added in v1.0.17
DefaultUpdaterLabel returns the default label for the update service in launchd
func Install ¶
func Install(context Context, binPath string, components []string, force bool, log Log) keybase1.InstallResult
Install installs all keybase components
func IsInUse ¶ added in v1.0.16
IsInUse returns true if the mount is in use. This may be used by the updater to determine if it's safe to apply an update and restart.
func KBFSBinPath ¶ added in v1.0.17
KBFSBinPath returns the path to the KBFS executable. If binPath (directory) is specifed, it will override the default (which is in the same directory where the keybase executable is).
func KBFSBundleVersion ¶
KBFSBundleVersion returns the bundle (not installed) version for KBFS
func KBFSServiceStatus ¶
func KBFSServiceStatus(context Context, label string, wait time.Duration, log Log) (status keybase1.ServiceStatus)
KBFSServiceStatus returns service status for KBFS
func KeybaseFuseStatus ¶
func KeybaseFuseStatus(bundleVersion string, log Log) keybase1.FuseStatus
KeybaseFuseStatus returns Fuse status
func KeybaseFuseStatusForAppBundle ¶
func KeybaseFuseStatusForAppBundle(appPath string, log Log) (keybase1.FuseStatus, error)
KeybaseFuseStatusForAppBundle returns Fuse status for application at appPath
func KeybaseServiceStatus ¶
func KeybaseServiceStatus(context Context, label string, wait time.Duration, log Log) (status keybase1.ServiceStatus)
KeybaseServiceStatus returns service status for Keybase service
func ListServices ¶
ListServices returns status for all services
func ResolveInstallStatus ¶
func ResolveInstallStatus(version string, bundleVersion string, lastExitStatus string, log Log) (installStatus keybase1.InstallStatus, installAction keybase1.InstallAction, status keybase1.Status)
ResolveInstallStatus will determine necessary install actions for the current environment
func RunAfterStartup ¶
RunAfterStartup runs after service startup
func ServiceStatus ¶
func ServiceStatus(context Context, label ServiceLabel, wait time.Duration, log Log) (*keybase1.ServiceStatus, error)
ServiceStatus returns status for a service named by label
func TerminateApp ¶ added in v1.0.17
TerminateApp will stop the Keybase (UI) app
func UninstallKBFS ¶ added in v1.0.16
UninstallKBFS uninstalls all KBFS services and unmounts the directory
func UpdaterBinPath ¶ added in v1.0.17
UpdaterBinPath returns the path to the updater executable, by default is in the same directory as the keybase executable.
func UpdaterServiceStatus ¶ added in v1.0.17
UpdaterServiceStatus returns service status for the Updater service
Types ¶
type ComponentName ¶
type ComponentName string
ComponentName defines a component name
const ( // ComponentNameCLI is the command line component ComponentNameCLI ComponentName = "cli" // ComponentNameService is the service component ComponentNameService ComponentName = "service" // ComponentNameKBFS is the KBFS component ComponentNameKBFS ComponentName = "kbfs" // ComponentNameUpdater is the updater component ComponentNameUpdater ComponentName = "updater" // ComponentNameApp is the UI app ComponentNameApp ComponentName = "app" // ComponentNameUnknown is placeholder for unknown components ComponentNameUnknown ComponentName = "unknown" )
func ComponentNameFromString ¶
func ComponentNameFromString(s string) ComponentName
ComponentNameFromString returns ComponentName from a string
func (ComponentName) Description ¶ added in v1.0.17
func (c ComponentName) Description() string
Description returns description for component name
func (ComponentName) String ¶
func (c ComponentName) String() string
String returns string for ComponentName
type Context ¶
type Context interface { GetConfigDir() string GetCacheDir() string GetRuntimeDir() string GetMountDir() (string, error) GetLogDir() string GetRunMode() libkb.RunMode GetServiceInfoPath() string GetKBFSInfoPath() string GetAppStartMode() (libkb.AppStartMode, error) }
Context is the enviroment for this package
type Log ¶ added in v1.0.17
type Log interface { Debug(s string, args ...interface{}) Info(s string, args ...interface{}) Warning(s string, args ...interface{}) Errorf(s string, args ...interface{}) }
Log is the logging interface for this package
type ServiceLabel ¶
type ServiceLabel string
ServiceLabel is an identifier string for a service
const ( // AppServiceLabel is the service label for the keybase launchd service in Keybase.app AppServiceLabel ServiceLabel = "keybase.service" // AppKBFSLabel is the service label for the kbfs launchd service in Keybase.app AppKBFSLabel ServiceLabel = "keybase.kbfs" // AppUpdaterLabel is the service label for the updater launchd service in Keybase.app AppUpdaterLabel ServiceLabel = "keybase.updater" // BrewServiceLabel is the service label for the updater launchd service in homebrew BrewServiceLabel ServiceLabel = "homebrew.mxcl.keybase" // BrewKBFSLabel is the service label for the kbfs launchd service in homebrew BrewKBFSLabel ServiceLabel = "homebrew.mxcl.kbfs" // UnknownLabel is an empty/unknown label UnknownLabel ServiceLabel = "" )
func NewServiceLabel ¶
func NewServiceLabel(s string) (ServiceLabel, error)
NewServiceLabel constructs a service label
func (ServiceLabel) ComponentName ¶
func (l ServiceLabel) ComponentName() ComponentName
ComponentName returns the component name for a service label
func (ServiceLabel) String ¶ added in v1.0.17
func (l ServiceLabel) String() string