dynamo-browse/internal/common/ui/events/commands.go
Leon Mika 0b745a6dfa ssm-browse: new utility to browse SSM parameters
This is more of an exercise to work out how best to use controllers
2022-03-29 08:41:27 +11:00

31 lines
486 B
Go

package events
import (
tea "github.com/charmbracelet/bubbletea"
"log"
)
func Error(err error) tea.Msg {
log.Println(err)
return ErrorMsg(err)
}
func SetStatus(msg string) tea.Cmd {
return func() tea.Msg {
return StatusMsg(msg)
}
}
func PromptForInput(prompt string, onDone func(value string) tea.Cmd) tea.Cmd {
return func() tea.Msg {
return PromptForInputMsg{
Prompt: prompt,
OnDone: onDone,
}
}
}
type MessageWithStatus interface {
StatusMessage() string
}