-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.go
More file actions
36 lines (29 loc) · 699 Bytes
/
models.go
File metadata and controls
36 lines (29 loc) · 699 Bytes
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
package simpleBubble
type fancyItem struct {
title, desc string
}
func (i fancyItem) Title() string { return i.title }
func (i fancyItem) Description() string { return i.desc }
func (i fancyItem) FilterValue() string { return i.title }
func NewFancyItem(title, desc string) fancyItem {
return fancyItem{
title: title,
desc: desc,
}
}
func NewFancyItems(items ...fancyItem) *[]fancyItem {
return &items
}
type checkListItem struct {
Text string
Checked bool
}
func NewCheckListItem(text string, checked bool) checkListItem {
return checkListItem{
Text: text,
Checked: checked,
}
}
func NewCheckListItems(items ...checkListItem) *[]checkListItem {
return &items
}