File: prompt.go

package info (click to toggle)
pat 0.19.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,228 kB
  • sloc: javascript: 3,864; sh: 147; makefile: 11
file content (30 lines) | stat: -rw-r--r-- 821 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package types

type PromptKind string

const (
	PromptKindPassword             PromptKind = "password"
	PromptKindMultiSelect          PromptKind = "multi-select"
	PromptKindBusyChannel          PromptKind = "busy-channel"
	PromptKindPreAccountActivation PromptKind = "pre-account-activation"
	PromptKindAccountActivation    PromptKind = "account-activation"
)

type Prompt struct {
	ID      string         `json:"id"`
	Kind    PromptKind     `json:"kind"`
	Message string         `json:"message"`
	Options []PromptOption `json:"options,omitempty"` // For multi-select
}

type PromptOption struct {
	Value   string `json:"value"`
	Desc    string `json:"desc,omitempty"`
	Checked bool   `json:"checked"`
}

type PromptResponse struct {
	ID    string `json:"id"`
	Value string `json:"value"`
	Err   error  `json:"error"`
}