Initial commit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
tui "github.com/grindlemire/go-tui"
|
||||
)
|
||||
|
||||
func main() {
|
||||
eventCh := make(chan string, 100)
|
||||
|
||||
app, err := tui.NewApp(
|
||||
tui.WithRootComponent(Dashboard(eventCh)),
|
||||
tui.WithMouse(),
|
||||
)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Failed to create app: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
defer app.Close()
|
||||
|
||||
go produceEvents(eventCh, app.StopCh())
|
||||
|
||||
if err := app.Run(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "App error: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user