mirror of
https://github.com/IllusionMan1212/gorc.git
synced 2026-10-24 02:12:33 +00:00
restructure app state, basic server connection using inputted user info and basic mainscreen
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package mainscreen
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
)
|
||||
|
||||
type ReceivedIRCCommandMsg struct {
|
||||
Msg string
|
||||
}
|
||||
|
||||
type InitialReadMsg struct{}
|
||||
|
||||
func InitialRead() tea.Msg {
|
||||
return InitialReadMsg{}
|
||||
}
|
||||
|
||||
func (s State) readFromServer() tea.Msg {
|
||||
msg, err := s.Reader.ReadString('\n')
|
||||
if err != nil {
|
||||
log.Print(err)
|
||||
}
|
||||
|
||||
return ReceivedIRCCommandMsg{Msg: msg}
|
||||
}
|
||||
Reference in New Issue
Block a user