TUI IRC client built from scratch in Go.
0

Configure Feed

Select the types of activity you want to include in your feed.

38 1 0

Clone this repository

https://tangled.org/liampallett.space/glirc https://tangled.org/did:plc:2yfyrjixwvlfukn76zixlrfb
git@tangled.org:liampallett.space/glirc git@tangled.org:did:plc:2yfyrjixwvlfukn76zixlrfb

For self-hosted knots, clone URLs may differ based on your setup.



README.md

glirc#

glirc is a CLI-based IRC client written in Go.


What the Project Is#

  • Learning project for Go and IRC

How It Works#

  • type Message struct for incoming and outgoing messages
  • parser/serializer for messages
  • type Client struct with handler maps for client and server message processing, goroutines and channels for I/O

Engineering Decisions#

type Client struct#

Took all code out of the main method and put it in client.go for separation of concerns and easier debugging.

*_handlers.go#

Parse input/output and call the appropriate method based on message command. Much easier to create, update and delete commands and their matching handlers.

Tech Stack#

  • Languages used: Go
  • Frameworks/libraries: tview (TUI)

What I Learned#

  • IRC is really cool!
  • Go is very interesting, glad to have got the experience with it.
  • Refactoring is important, I will make sure that I take this into account for my future projects.

How to Run the Project#

Note: you will need a config.json file containing your nickname, username, server, connection type and port. Place this in the root directory after cloning the repository.

Note: the connection type will affect the port that you connect to. Please check the documentation for the server you are connecting to. For modern IRC connections, TLS is preferred (and is most likely the default for the connection listed in the documentation)

{
    "nick": "yournick",
    "user": "Your Name",
    "server": "irc.libera.chat",
    "connection-type": "tls",
    "port": 6697
}
git clone https://github.com/liampallett/glirc.git 
cd glirc
go build
./glirc

Project Structure#

├── LICENSE.md
├── README.md
├── client.go
├── client_handlers.go
├── config.go
├── go.mod
├── main.go
├── message.go
├── parser_test.go
├── server_handlers.go
└── ui.go

Future Improvements#

  • Expand TUI
  • More supported commands.