irc icon indicating copy to clipboard operation
irc copied to clipboard

Changes for v4

Open belak opened this issue 5 years ago • 5 comments

Hello all!

I've been looking at releasing v4 of this library, mostly as a slightly simpler version and splitting some utilities I keep having to make out into a separate ircx package. I wanted to run all these past people before I just go ahead and do them though.

  • Move client out to ircx - the idea is to keep the base package to only protocol-related tools like reading and writing messages, numerics, etc.
  • Change the import path to gopkg.in/go-irc/irc.v4 - this will allow us to also have gopkg.in/go-irc/ircx.v0 rather than gopkg.in/irc.v4 and the longer form for ircx
  • Taking a look at better context support for Conn. Potentially seeing if there's a good way to handle a Write with a timeout.

Additional tools meant for ircx:

  • Client - I have some ideas for better Context support
  • ISupport parsing/tools
  • Some form of tracker which allows you to track which channels you're in, what their topics are, and what nicks are in each channel. I could potentially add user mode tracking as well.

Does anyone have any thoughts?

belak avatar May 03 '20 13:05 belak

As long as the original 'building block' base is available at some path, that should be generally agreeable, the subpath doesn't seem troublesome. It makes sense to have a 'reference implementation' of sorts for people wanting somewhat more work done for them.

One thing I'd love to see in a new major version is either first-class SASL support, or at least the necessary reworkings to allow hooking the registration flow so we can perform the SASL dance ourselves (https://github.com/go-irc/irc/issues/57#issuecomment-379926246). Not having support for 'properly' logging into servers has been a papercut for my general use client.

For prior art—another go client which supports both PLAIN and EXTERNAL (certfp) SASL has a SASLMech interface with two default types, you can just slot one instance into the connection configuration. Not sure if that level of support would be more irc or ircx under your v4 blueprint.

danopia avatar May 07 '20 11:05 danopia

Yep, I plan on leaving Conn, Reader, Writer, Event, and Prefix mostly untouched. SASL would fit in the ircx package. I'll have to check out that implementation and see if I can come up with anything.

belak avatar May 07 '20 12:05 belak

I had a bit of time so I started work on this.

Unfortunately, it doesn't look like gopkg.in handles alpha versions, so I'm temporarily moving this library back to the github namespace until it actually gets merged in. At that point, it will most likely go back to gopkg.in. For now the import paths are as follows:

  • github.com/go-irc/irc/v4
  • github.com/go-irc/ircx

Things that have been done so far:

  • ircx package has been created
  • The semi-hacky API for Conn.WriteCallback has been made public so the Client can live in another package
  • Client has been moved into ircx
  • ISupportTracker has been ported from another project of mine
  • Basic channel tracker has been ported from another project of mine
  • ~Some simple tweaks to Conn to add a Close method, so if you're wrapping it, it's a little easier - I may back out of this one since it seems a little weird to require a ReadWriteCloser just to export a Close method when a ReadWriter will do~

And this is where I semi-rant about Go package management... I really wish that suffix wasn't required. It's really frustrating needing to add /v4 for v2+ but not for v0 and v1. It's a small, but fairly frustrating thing. I know the problem it's trying to solve... and I get it... but man, I really don't like those import paths.

belak avatar May 29 '20 09:05 belak

Things left to do:

  • SASL
  • Tests for ISupport
  • Tests for Tracker
  • Context support
  • Fixing CI - we seem to be running into https://github.com/actions-contrib/golangci-lint/issues/11 - I may look at tweaking it a bit and using a custom version so we can get the github-actions output, but we'll have to see... I'd expect that stuff to make it upstream eventually.

belak avatar May 29 '20 09:05 belak

I'm actually re-thinking this - I'm in the progress of moving Client back from ircx, and adding Tracker/ISupport under a new release. If/when breaking changes happen (like improved context support) I will do a major version bump.

belak avatar Sep 22 '21 19:09 belak

I don't have the time to work on improved Context support at the moment, so I'm going to leave that for v5.

belak avatar Sep 11 '22 18:09 belak

v4.0.0 was merged and tagged!

belak avatar Sep 11 '22 18:09 belak