Add field in Conn to allow external state to be propagated to event handlers.

This commit is contained in:
Alex Bramley 2011-07-25 22:27:09 +01:00
parent 830dbcbb7f
commit ddd913547c
1 changed files with 4 additions and 0 deletions

View File

@ -29,6 +29,10 @@ type Conn struct {
// Map of nicks we know about // Map of nicks we know about
nicks map[string]*Nick nicks map[string]*Nick
// Use the State field to store external state that handlers might need.
// Remember ... you might need locking for this ;-)
State interface{}
// I/O stuff to server // I/O stuff to server
sock net.Conn sock net.Conn
io *bufio.ReadWriter io *bufio.ReadWriter