Merge pull request #103 from sadbox/master

Add support for Handler timeouts via context
This commit is contained in:
Thomas Jager
2018-08-16 06:30:43 +02:00
committed by GitHub
3 changed files with 63 additions and 23 deletions

View File

@@ -5,6 +5,7 @@
package irc
import (
"context"
"crypto/tls"
"log"
"net"
@@ -30,6 +31,7 @@ type Connection struct {
TLSConfig *tls.Config
Version string
Timeout time.Duration
CallbackTimeout time.Duration
PingFreq time.Duration
KeepAlive time.Duration
Server string
@@ -70,6 +72,7 @@ type Event struct {
Arguments []string
Tags map[string]string
Connection *Connection
Ctx context.Context
}
// Retrieve the last message from Event arguments.