-
Notifications
You must be signed in to change notification settings - Fork 0
/
structs.go
74 lines (61 loc) · 1.35 KB
/
structs.go
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package main
import (
"github.com/charmbracelet/bubbles/help"
"github.com/charmbracelet/bubbles/key"
"github.com/charmbracelet/bubbles/spinner"
"github.com/charmbracelet/bubbles/textinput"
)
type model struct {
keymap keymap
commitMsgCursor int
selected map[int]struct{}
commitChoices []string
aiModelCursor int
aiModel string
aiModels []string
maxTokens int
useConventional bool
apiKey string
authenticated bool
fetching bool
fetchError bool
shouldRefetchForNewModel bool
appstate int
commitState commitState
help help.Model
spinner spinner.Model
textInput textinput.Model
}
type commitState struct {
chosenMsg string
committed bool
committing bool
commitOutput string
err error
}
type keymap struct {
Quit key.Binding
Enter key.Binding
Up key.Binding
Down key.Binding
Escape key.Binding
Retry key.Binding
Authenticate key.Binding
ChooseAIModel key.Binding
}
type (
requestStrResponse struct{ data string }
requestResponse struct{ data []string }
requestError struct{ err error }
commitResult struct {
output string
err error
}
)
const (
Choosing = iota
Authenticating = iota
Quitting = iota
Committing = iota
ChoosingAIModel = iota
)