version

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "development"
View Source
var VersionCmd = &cobra.Command{
	Use:   "version",
	Short: "Shows the version of the Agent and CLI.",
	Run: func(cmd *cobra.Command, args []string) {

		req := api.VersionRequest{}
		port := viper.GetString("agent.port")
		conn, err := grpc.Dial("127.0.0.1:"+port, grpc.WithTransportCredentials(insecure.NewCredentials()))
		if err != nil {
			fmt.Println("Error connecting to GRPC Server: ", err)
			return
		}
		defer conn.Close()

		client := api.NewAgentClient(conn)

		versionResponse, err := client.Version(context.Background(), &req)
		if err != nil {
			shared.HandleAgentError(err, fmt.Sprintf("Error: Unable to complete Version command: %v", err))
			return
		}

		fmt.Println("Pennsieve Agent")
		fmt.Println(fmt.Sprintf("Agent Version  :%20s\n"+
			"CLI Version    :%20s\n"+
			"Log Level      :%20s\n", versionResponse.Version, Version, versionResponse.LogLevel))

	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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