cmd

package
v0.14.7-rc.7 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StartCmd = cobra.Command{
	Use:   "start",
	Short: "Start the local agent",
	Long:  "Start the local agent",
	Run: func(cmd *cobra.Command, args []string) {
		ctx := cmd.Context()
		cfg, err := config.LoadConfig()
		if err != nil {
			fmt.Fprintln(os.Stderr, err)
			ExitCLI(1)
		}

		log.Printf("starting agent [%s] connecting to %s", cfg.Name, cfg.ServerURL)

		session, err := initialization.Start(ctx, cfg)
		if err != nil {
			fmt.Fprintln(os.Stderr, err)
			ExitCLI(1)
		}

		session.WaitUntilDisconnected()
		session.Close()
	},
}

Functions

func Execute

func Execute()

func ExitCLI

func ExitCLI(errorCode int)

func RegisterCLIExitInterceptor

func RegisterCLIExitInterceptor(interceptor func(int))

Types

This section is empty.

Jump to

Keyboard shortcuts

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