-
Notifications
You must be signed in to change notification settings - Fork 24
/
property.go
53 lines (44 loc) · 912 Bytes
/
property.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
package api
import (
"strings"
"github.com/diamondburned/gotk4-adwaita/pkg/adw"
"github.com/diamondburned/gotk4/pkg/gtk/v4"
corev1 "k8s.io/api/core/v1"
)
type Property interface {
GetID() string
GetPriority() int32
}
type TextProperty struct {
ID string
Priority int32
Name string
Value string
Reference *corev1.ObjectReference
Widget func(gtk.Widgetter, *adw.NavigationView)
}
func (p *TextProperty) GetID() string {
if p.ID == "" {
return strings.ToLower(p.Name)
}
return p.ID
}
func (p *TextProperty) GetPriority() int32 {
return 0
}
type GroupProperty struct {
ID string
Priority int32
Name string
Children []Property
Widget func(gtk.Widgetter, *adw.NavigationView)
}
func (p *GroupProperty) GetID() string {
if p.ID == "" {
return strings.ToLower(p.Name)
}
return p.ID
}
func (p *GroupProperty) GetPriority() int32 {
return p.Priority
}