Compare commits
3 Commits
5ad2c37ba2
...
8854b17ebc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8854b17ebc | ||
|
|
6fa46f4b75 | ||
|
|
a89393186f |
15
README.md
15
README.md
@@ -2311,15 +2311,18 @@ neoirc/
|
|||||||
├── cmd/
|
├── cmd/
|
||||||
│ ├── neoircd/ # Server binary entry point
|
│ ├── neoircd/ # Server binary entry point
|
||||||
│ │ └── main.go
|
│ │ └── main.go
|
||||||
│ └── neoirc-cli/ # TUI client
|
│ └── neoirc-cli/ # TUI client entry point
|
||||||
│ ├── main.go # Command handling, poll loop
|
│ └── main.go # Minimal bootstrapping (calls internal/cli)
|
||||||
│ ├── ui.go # tview-based terminal UI
|
|
||||||
│ └── api/
|
|
||||||
│ ├── client.go # HTTP API client library
|
|
||||||
│ └── types.go # Request/response types
|
|
||||||
├── internal/
|
├── internal/
|
||||||
│ ├── broker/ # In-memory pub/sub for long-poll notifications
|
│ ├── broker/ # In-memory pub/sub for long-poll notifications
|
||||||
│ │ └── broker.go
|
│ │ └── broker.go
|
||||||
|
│ ├── cli/ # TUI client implementation
|
||||||
|
│ │ ├── app.go # App struct, command handling, poll loop
|
||||||
|
│ │ ├── ui.go # tview-based terminal UI
|
||||||
|
│ │ └── api/
|
||||||
|
│ │ ├── client.go # HTTP API client library
|
||||||
|
│ │ ├── types.go # Request/response types
|
||||||
|
│ │ └── hashcash.go # Hashcash proof-of-work minting
|
||||||
│ ├── config/ # Viper-based configuration
|
│ ├── config/ # Viper-based configuration
|
||||||
│ │ └── config.go
|
│ │ └── config.go
|
||||||
│ ├── db/ # Database access and migrations
|
│ ├── db/ # Database access and migrations
|
||||||
|
|||||||
@@ -1,17 +1,8 @@
|
|||||||
// Package main is the entry point for the neoirc-cli client.
|
// Package main is the entry point for the neoirc-cli client.
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import "git.eeqj.de/sneak/neoirc/internal/cli"
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"git.eeqj.de/sneak/neoirc/internal/cli"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
err := cli.Run()
|
cli.Run()
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
// Package cli implements the neoirc-cli client logic.
|
// Package cli implements the neoirc-cli terminal client.
|
||||||
package cli
|
package cli
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@@ -31,8 +32,8 @@ type App struct {
|
|||||||
stopPoll chan struct{}
|
stopPoll chan struct{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run starts the neoirc-cli application.
|
// Run creates and runs the CLI application.
|
||||||
func Run() error {
|
func Run() {
|
||||||
app := &App{ //nolint:exhaustruct
|
app := &App{ //nolint:exhaustruct
|
||||||
ui: NewUI(),
|
ui: NewUI(),
|
||||||
nick: "guest",
|
nick: "guest",
|
||||||
@@ -50,7 +51,11 @@ func Run() error {
|
|||||||
"or [yellow]/help[white] for commands",
|
"or [yellow]/help[white] for commands",
|
||||||
)
|
)
|
||||||
|
|
||||||
return app.ui.Run()
|
err := app.ui.Run()
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) handleInput(text string) {
|
func (a *App) handleInput(text string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user