install

package
v1.0.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2016 License: BSD-3-Clause, BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ComponentNames are all the valid component names

Functions

func AfterUpdateApply added in v1.0.17

func AfterUpdateApply(context Context, willRestart bool, force bool, log Log) error

AfterUpdateApply runs after an update has been applied

func AppBundleForPath added in v1.0.17

func AppBundleForPath() (string, error)

AppBundleForPath returns path to app bundle

func AutoInstall

func AutoInstall(context Context, binPath string, force bool, log Log) (newProc bool, err error)

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 BinPath added in v1.0.17

func BinPath() (string, error)

BinPath returns path to the keybase executable

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

func DefaultKBFSLabel(runMode libkb.RunMode) string

DefaultKBFSLabel returns the default label for KBFS service in launchd

func DefaultLaunchdEnvVars

func DefaultLaunchdEnvVars(label string) []launchd.EnvVar

DefaultLaunchdEnvVars returns default environment vars for launchd

func DefaultServiceLabel

func DefaultServiceLabel(runMode libkb.RunMode) string

DefaultServiceLabel returns the default label for Keybase service in launchd

func DefaultUpdaterLabel added in v1.0.17

func DefaultUpdaterLabel(runMode libkb.RunMode) string

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

func IsInUse(mountDir string, log Log) bool

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 KBFS added in v1.0.17

func KBFS(context Context, binPath string, force bool, log Log) error

KBFS installs the KBFS service

func KBFSBinPath added in v1.0.17

func KBFSBinPath(runMode libkb.RunMode, binPath string) (string, error)

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

func KBFSBundleVersion(context Context, binPath string) (string, error)

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

func ListServices(context Context, wait time.Duration, log Log) (*keybase1.ServicesStatus, error)

ListServices returns status for all services

func OSVersion

func OSVersion() (semver.Version, error)

OSVersion returns the OS version

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

func RunAfterStartup(context Context, isService bool, log Log)

RunAfterStartup runs after service startup

func RunApp added in v1.0.17

func RunApp(context Context, log Log) error

RunApp starts the app

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

func TerminateApp(context Context, log Log) error

TerminateApp will stop the Keybase (UI) app

func Uninstall

func Uninstall(context Context, components []string, log Log) keybase1.UninstallResult

Uninstall uninstalls all keybase services

func UninstallKBFS added in v1.0.16

func UninstallKBFS(runMode libkb.RunMode, mountDir string, forceUnmount bool, log Log) error

UninstallKBFS uninstalls all KBFS services and unmounts the directory

func UpdaterBinPath added in v1.0.17

func UpdaterBinPath() (string, error)

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

func UpdaterServiceStatus(context Context, label string) keybase1.ServiceStatus

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL