github.com/tilt-dev/tilt@v0.33.15-0.20240515162809-0a22ed45d8a0/internal/store/uibuttons/actions.go (about)

     1  package uibuttons
     2  
     3  import (
     4  	"k8s.io/apimachinery/pkg/types"
     5  
     6  	"github.com/tilt-dev/tilt/internal/store"
     7  	"github.com/tilt-dev/tilt/pkg/apis/core/v1alpha1"
     8  )
     9  
    10  type UIButtonUpsertAction struct {
    11  	UIButton *v1alpha1.UIButton
    12  }
    13  
    14  var _ store.Summarizer = UIButtonUpsertAction{}
    15  
    16  func NewUIButtonUpsertAction(obj *v1alpha1.UIButton) UIButtonUpsertAction {
    17  	return UIButtonUpsertAction{UIButton: obj}
    18  }
    19  
    20  func (a UIButtonUpsertAction) Summarize(summary *store.ChangeSummary) {
    21  	summary.UIButtons.Add(types.NamespacedName{Name: a.UIButton.Name})
    22  }
    23  
    24  func (UIButtonUpsertAction) Action() {}
    25  
    26  type UIButtonDeleteAction struct {
    27  	Name string
    28  }
    29  
    30  var _ store.Summarizer = UIButtonDeleteAction{}
    31  
    32  func NewUIButtonDeleteAction(n string) UIButtonDeleteAction {
    33  	return UIButtonDeleteAction{Name: n}
    34  }
    35  
    36  func (a UIButtonDeleteAction) Summarize(summary *store.ChangeSummary) {
    37  	summary.UIButtons.Add(types.NamespacedName{Name: a.Name})
    38  }
    39  
    40  func (UIButtonDeleteAction) Action() {}