refactor: change project structure

This commit is contained in:
2022-01-24 02:26:24 +02:00
parent cfeadeedd1
commit e34cc39e63
11 changed files with 316 additions and 325 deletions
-23
View File
@@ -17,32 +17,9 @@
package mainscreen
import (
"io"
"log"
"strings"
tea "github.com/charmbracelet/bubbletea"
"github.com/illusionman1212/gorc/parser"
)
func (s *State) ReadLoop() {
for {
msg, err := s.ConnReader.ReadString('\n')
if err != nil {
if err != io.EOF {
log.Println(err)
}
s.Client.TcpConn.Close()
return
}
msg = strings.Replace(msg, "\r\n", "", 1)
if ircMessage, valid := parser.ParseIRCMessage(msg); valid {
s.HandleCommand(ircMessage)
}
}
}
type SendPrivMsg struct {
Msg string
}