thoj/go-ircevent — pull request #20 by darkliquid (2014-02-09 11:30:48+00:00)
Title: Added configurable timeouts and overridable version string

This patch adds in the ability to override the default version string (if you want to identify you're connection's client version differently) and also add in the ability to configure the ping frequency, keep alive and connection timeouts (some servers need special treatment or dislike ping frequencies that are too often, etc plus now things wont get locked up waiting forever on a connection to be established).

These are just exported properties on the main connection struct, so you can set them up after instantiating, like so:

```go

conn := irc.IRC("nick", "user")
conn.KeepAlive = 4 * time.Minute
conn.Timeout = 1 * time.Minute
conn.PingFreq = 15 * time.Minute
conn.Version = "my-version-string"

```

The only caveat currently with this is that PingFreq *must* be set before connecting, since the tickers do not get reinitialised.

There is no protection from setting 0 timeouts or 0 ping frequencies beyond the default behaviours for those things (tickers will panic on a 0 time duration, timeouts will be disabled when set to 0, keepalives will happen every minute if set to 0, since it's a wait time, not a frequency)