MCPcopy Create free account
hub / github.com/cloudquery/cloudquery / newCmdLogin

Function newCmdLogin

cli/cmd/login.go:47–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45)
46
47func newCmdLogin() *cobra.Command {
48 loginCmd := &cobra.Command{
49 Use: "login",
50 Short: loginShort,
51 Long: loginLong,
52 Example: loginExample,
53 Args: cobra.MatchAll(cobra.ExactArgs(0), cobra.OnlyValidArgs),
54 RunE: func(cmd *cobra.Command, args []string) error {
55 // Set up a channel to listen for OS signals for graceful shutdown.
56 ctx, cancel := context.WithCancel(cmd.Context())
57
58 sigChan := make(chan os.Signal, 1)
59 signal.Notify(sigChan, syscall.SIGTERM)
60
61 go func() {
62 <-sigChan
63 cancel()
64 }()
65
66 return runLogin(ctx, cmd)
67 },
68 }
69 loginCmd.Flags().StringP("team", "t", "", "Team to login to. Specify the team name, e.g. 'my-team' (not the display name)")
70 return loginCmd
71}
72
73func waitForServer(ctx context.Context, url string) error {
74 ctx, cancel := context.WithTimeout(ctx, 3*time.Second)

Callers 1

NewCmdRootFunction · 0.85

Calls 2

runLoginFunction · 0.85
ContextMethod · 0.45

Tested by

no test coverage detected