-
Notifications
You must be signed in to change notification settings - Fork 293
/
actions.go
40 lines (28 loc) · 959 Bytes
/
actions.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
package uibuttons
import (
"k8s.io/apimachinery/pkg/types"
"github.com/tilt-dev/tilt/internal/store"
"github.com/tilt-dev/tilt/pkg/apis/core/v1alpha1"
)
type UIButtonUpsertAction struct {
UIButton *v1alpha1.UIButton
}
var _ store.Summarizer = UIButtonUpsertAction{}
func NewUIButtonUpsertAction(obj *v1alpha1.UIButton) UIButtonUpsertAction {
return UIButtonUpsertAction{UIButton: obj}
}
func (a UIButtonUpsertAction) Summarize(summary *store.ChangeSummary) {
summary.UIButtons.Add(types.NamespacedName{Name: a.UIButton.Name})
}
func (UIButtonUpsertAction) Action() {}
type UIButtonDeleteAction struct {
Name string
}
var _ store.Summarizer = UIButtonDeleteAction{}
func NewUIButtonDeleteAction(n string) UIButtonDeleteAction {
return UIButtonDeleteAction{Name: n}
}
func (a UIButtonDeleteAction) Summarize(summary *store.ChangeSummary) {
summary.UIButtons.Add(types.NamespacedName{Name: a.Name})
}
func (UIButtonDeleteAction) Action() {}