Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cobra.Command{ Use: "status", Short: "get status of your current context (user, account, environment, vpn status)", Example: fn.Desc("{cmd} status"), Run: func(_ *cobra.Command, _ []string) { if u, err := server.GetCurrentUser(); err == nil { fn.Logf("\nLogged in as %s (%s)\n", text.Blue(u.Name), text.Blue(u.Email), ) } if s, err := client.CurrentAccountName(); err == nil { fn.Log(fmt.Sprint(text.Bold(text.Blue("Account: ")), s)) } switch flags.CliName { case constants.CoreCliName: { if e, err := client.CurrentEnv(); err == nil { fn.Log(fmt.Sprint(text.Bold(text.Blue("Environment: ")), e.Name)) } } case constants.InfraCliName: { if s, err := client.CurrentClusterName(); err == nil { fn.Log(fmt.Sprint(text.Bold(text.Blue("Cluster: ")), s)) } } } if s, err := client.CurrentDeviceName(); err == nil { b := server.CheckDeviceStatus() fn.Log(fmt.Sprint(text.Bold(text.Blue("Device: ")), s, func() string { if b { return text.Bold(text.Green(" (Connected) ")) } else { return text.Bold(text.Red(" (Disconnected) ")) } }())) ip, err := client.CurrentDeviceIp() if err == nil { fn.Logf("%s %s", text.Bold(text.Blue("Device IP:")), *ip) } } }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.