mirror of
https://github.com/IllusionMan1212/gorc.git
synced 2026-10-24 02:12:33 +00:00
add bubbletea, bubbles, lipgloss and term as deps. initial work on ui
This commit is contained in:
@@ -17,24 +17,31 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"log"
|
||||
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// create new client with the provided host and port
|
||||
client := NewClient("irc.libera.chat", "6697")
|
||||
defer client.conn.Close()
|
||||
go client.Run()
|
||||
|
||||
// main loop
|
||||
r := bufio.NewReaderSize(client.conn, 512)
|
||||
for {
|
||||
msg, err := r.ReadString('\n')
|
||||
if err != nil {
|
||||
log.Print(err)
|
||||
}
|
||||
|
||||
client.receive <- msg
|
||||
if err := tea.NewProgram(initialState(), tea.WithAltScreen()).Start(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
/*
|
||||
// create new client with the provided host and port
|
||||
client := NewClient("irc.libera.chat", "6697")
|
||||
defer client.conn.Close()
|
||||
go client.Run()
|
||||
|
||||
// main loop
|
||||
r := bufio.NewReaderSize(client.conn, 512)
|
||||
for {
|
||||
msg, err := r.ReadString('\n')
|
||||
if err != nil {
|
||||
log.Print(err)
|
||||
}
|
||||
|
||||
client.receive <- msg
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user