本文整理匯總了Golang中github.com/giancosta86/moondeploy/v3/launchers.Launcher.GetSettings方法的典型用法代碼示例。如果您正苦於以下問題:Golang Launcher.GetSettings方法的具體用法?Golang Launcher.GetSettings怎麽用?Golang Launcher.GetSettings使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/giancosta86/moondeploy/v3/launchers.Launcher
的用法示例。
在下文中一共展示了Launcher.GetSettings方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: executeCommand
func executeCommand(launcher launchers.Launcher, command string) (err error) {
settings := launcher.GetSettings()
switch command {
case verbs.Serve:
return verbs.DoServe()
default:
return verbs.DoRun(launcher, settings)
}
}
示例2: Run
/*
Run is the entry point you must employ to create a custom installer, for example to
employ custom settings or a brand-new user interface, based on any technology
*/
func Run(
launcher launchers.Launcher,
userInterface ui.UserInterface,
bootDescriptor descriptors.AppDescriptor) (err error) {
settings := launcher.GetSettings()
//----------------------------------------------------------------------------
setupUserInterface(launcher, userInterface)
defer dismissUserInterface(userInterface)
//----------------------------------------------------------------------------
userInterface.SetHeader("Performing startup operations")
log.Debug("The boot descriptor is: %#v", bootDescriptor)
//----------------------------------------------------------------------------
userInterface.SetApp(bootDescriptor.GetName())
//----------------------------------------------------------------------------
appGallery := apps.NewAppGallery(settings.GetGalleryDirectory())
log.Debug("The app gallery is: %#v", appGallery)
//----------------------------------------------------------------------------
log.Info("Resolving the app...")
app, err := appGallery.GetApp(bootDescriptor)
if err != nil {
return err
}
log.Notice("The app directory is: '%v'", app.Directory)
log.Debug("App is: %#v", app)
firstRun := !app.DirectoryExists()
log.Debug("Is this a first run for the app? %v", firstRun)
//----------------------------------------------------------------------------
if firstRun {
log.Info("Now asking the user if the app can run...")
canRun := app.CanPerformFirstRun(userInterface)
if !canRun {
return &ExecutionCanceled{}
}
log.Debug("The user agreed to proceed")
log.Info("Ensuring the app dir is available...")
err = app.EnsureDirectory()
if err != nil {
return err
}
log.Notice("App dir available")
}
//----------------------------------------------------------------------------
log.Info("Locking the app dir...")
err = app.LockDirectory()
if err != nil {
return err
}
defer func() {
unlockErr := app.UnlockDirectory()
if unlockErr != nil {
log.Warning(unlockErr.Error())
}
}()
log.Notice("App dir locked")
//----------------------------------------------------------------------------
log.Info("Checking for conflicting local descriptors...")
err = app.CheckForConflictingLocalDescriptors()
if err != nil {
return err
}
log.Notice("No conflicting local descriptors found")
//----------------------------------------------------------------------------
log.Info("Resolving the local descriptor...")
localDescriptor := app.GetLocalDescriptor()
startedWithLocalDescriptor := localDescriptor != nil
log.Debug("Started with local descriptor? %v", startedWithLocalDescriptor)
if startedWithLocalDescriptor {
log.Info("Checking that local descriptor and boot descriptor actually match...")
//.........這裏部分代碼省略.........