MCPcopy Create free account
hub / github.com/OverloadBlitz/cloudcent-cli / handleInitAuthKey

Method handleInitAuthKey

internal/tui/app.go:271–303  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

269}
270
271func (a App) handleInitAuthKey(key string) (tea.Model, tea.Cmd) {
272 switch a.authState {
273 case AuthStatePrompt:
274 switch key {
275 case "enter":
276 a.authState = AuthStateWaiting
277 return a, startAuthCmd(a.client)
278 case "esc", "ctrl+c", "q":
279 return a, tea.Quit
280 }
281 case AuthStateWaiting:
282 switch key {
283 case "esc", "ctrl+c":
284 return a, tea.Quit
285 case "r", "R":
286 a.authState = AuthStateWaiting
287 return a, startAuthCmd(a.client)
288 }
289 case AuthStateLoading:
290 if key == "esc" || key == "ctrl+c" {
291 return a, tea.Quit
292 }
293 case AuthStateError:
294 switch key {
295 case "enter":
296 a.authState = AuthStatePrompt
297 a.errorMsg = ""
298 case "esc", "ctrl+c":
299 return a, tea.Quit
300 }
301 }
302 return a, nil
303}
304
305func (a App) handlePricingEvent(event views.PricingEvent) (tea.Model, tea.Cmd) {
306 switch event {

Callers 1

handleKeyMethod · 0.95

Calls 1

startAuthCmdFunction · 0.85

Tested by

no test coverage detected