Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RegisteredFrameworks = [...]common.ServeFramework{ flowServe.NewFlowFramework(), }
View Source
var ServeCmd = &cobra.Command{ Use: "serve", Short: "Wizard to be executed in source", Long: `The server part is run on the source / production system, where it automatically discovers used frameworks and figures out what to extract.`, Example: `synco serve`, Run: func(cmd *cobra.Command, args []string) { sigs := make(chan os.Signal, 1) signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM) var err error if len(password) == 0 { password, err = util.GenerateRandomString(30) if err != nil { pterm.Fatal.Printfln("Error generating random password: %s", err) } } if len(identifier) == 0 { identifier, err = util.GenerateRandomString(7) if err != nil { pterm.Fatal.Printfln("Error generating identifier password: %s", err) } } progressbar, err := pterm.DefaultProgressbar.WithTotal(3).Start() pterm.PrintOnErrorf("Error initializing progress bar: %e", err) pterm.Debug.Printfln("Detecting Frameworks") for _, framework := range RegisteredFrameworks { progressbar.Add(1) pterm.Debug.Printfln("Checking for %s framework", framework.Name()) if framework.Detect() { pterm.Info.Printfln("Found %s framework.", framework.Name()) transferSession, err := serve.NewSession(identifier, password, listen, sigs) if err != nil { pterm.Fatal.Printfln("Error creating transfer session: %s", err) } framework.Serve(transferSession) pterm.Debug.Printfln("Waiting for ctrl-c") return } } pterm.Error.Printfln("No frameworks could be detected. Aborting.") os.Exit(1) }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.