init porkbacon tui project
This commit is contained in:
commit
55be985ca7
5 changed files with 127 additions and 0 deletions
31
internal/app/app.go
Normal file
31
internal/app/app.go
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package app
|
||||
|
||||
import (
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
)
|
||||
|
||||
type App struct {
|
||||
}
|
||||
|
||||
func New() App {
|
||||
return App{}
|
||||
}
|
||||
|
||||
func (a App) Init() tea.Cmd {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a App) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
switch msg := msg.(type) {
|
||||
case tea.KeyMsg:
|
||||
switch msg.String() {
|
||||
case "ctrl+c", "q":
|
||||
return a, tea.Quit
|
||||
}
|
||||
}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
func (a App) View() string {
|
||||
return "porkbacon app"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue