irc-go/irc_struct.go

56 lines
1.2 KiB
Go
Raw Normal View History

2012-11-05 22:46:47 +00:00
// 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 (
"crypto/tls"
2012-11-05 22:46:47 +00:00
"log"
"net"
"time"
2012-11-05 22:46:47 +00:00
)
type Connection struct {
Debug bool
Error chan error
Password string
2012-11-07 20:55:33 +00:00
UseTLS bool
TLSConfig *tls.Config
Version string
Timeout time.Duration
PingFreq time.Duration
KeepAlive time.Duration
2013-03-13 11:54:00 +00:00
socket net.Conn
netsock net.Conn
2013-03-13 11:54:00 +00:00
pread, pwrite chan string
readerExit, writerExit, pingerExit chan bool
endping, endread, endwrite chan bool
nick string //The nickname we want.
nickcurrent string //The nickname we currently have.
user string
registered bool
server string
2012-11-05 23:39:31 +00:00
events map[string][]func(*Event)
2012-11-05 22:46:47 +00:00
lastMessage time.Time
2012-11-05 22:46:47 +00:00
VerboseCallbackHandler bool
log *log.Logger
stopped bool
2012-11-05 22:46:47 +00:00
}
type Event struct {
Code string
Message string
Raw string
Nick string //<nick>
Host string //<nick>!<usr>@<host>
Source string //<host>
User string //<usr>
2012-11-05 22:46:47 +00:00
Arguments []string
}