go-ircevent/irc_struct.go
tj 79ac1741ea Add irccon.Quit() and irccon.Cycle()
Quit() Sends QUIT to server and exits the main loop.
Cycle() Sends QUIT to server and reconnects.
2010-10-18 21:46:34 +02:00

42 lines
884 B
Go

// Copyright 2009 Thomas Jager <mail@jager.no> All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package irc
import (
"os"
"net"
)
type IRCConnection struct {
socket net.Conn
pread, pwrite chan string
Error chan os.Error
syncreader, syncwriter chan bool
nick string
user string
registered bool
server string
Password string
events map[string][]func(*IRCEvent)
lastMessage int64
ticker <-chan int64
ticker2 <-chan int64
quitting bool
}
type IRCEvent struct {
Code string
Message string
Raw string
Nick string //<nick>
Host string //<nick>!<usr>@<host>
Source string //<host>
User string //<usr>
Arguments []string
}