Documentation ¶
Overview ¶
Package irc provides a IRC client, implementing IRC protocol, for communicating with an IRC server.
Index ¶
- Constants
- type Client
- func (c *Client) Command(code string, message string, params ...string)
- func (c *Client) Dial(server string) (err error)
- func (c *Client) Disconnect()
- func (c *Client) Join(channels ...string)
- func (c *Client) Nick() string
- func (c *Client) Notice(target, message string)
- func (c *Client) Noticef(target, format string, a ...interface{})
- func (c *Client) Part(channels ...string)
- func (c *Client) Ping()
- func (c *Client) Privmsg(target, message string)
- func (c *Client) Privmsgf(target, format string, a ...interface{})
- func (c *Client) Quit()
- func (c *Client) Raw(message string)
- func (c *Client) Rawf(format string, a ...interface{})
- func (c *Client) Serve() error
- func (c *Client) SetHandler(code string, handler func(*Event))
- func (c *Client) SetNick(nick string)
- func (c *Client) Start(socket net.Conn)
- type Event
Constants ¶
View Source
const ( NICK = "NICK" USER = "USER" PASS = "PASS" JOIN = "JOIN" PART = "PART" QUIT = "QUIT" NOTICE = "NOTICE" PRIVMSG = "PRIVMSG" PING = "PING" PONG = "PONG" TIME = "TIME" MODE = "MODE" ERROR = "ERROR" VERSION = "VERSION" CLIENTINFO = "CLIENTINFO" USERINFO = "USERINFO" CTCP = "CTCP" CTCP_VERSION = "CTCP_VERSION" CTCP_TIME = "CTCP_TIME" CTCP_PING = "CTCP_PING" CTCP_USERINFO = "CTCP_USERINFO" CTCP_CLIENTINFO = "CTCP_CLIENTINFO" RPL_WELCOME = "001" RPL_YOURHOST = "002" RPL_CREATED = "003" RPL_MYINFO = "004" RPL_ISUPPORT = "005" RPL_STATSCONN = "250" RPL_LUSERCLIENT = "251" RPL_LUSEROP = "252" RPL_LUSERUNKNOWN = "253" RPL_LUSERCHANNELS = "254" RPL_LUSERME = "255" RPL_LOCALUSERS = "265" RPL_GLOBALUSERS = "266" RPL_TOPIC = "332" RPL_NAMREPLY = "353" RPL_ENDOFNAMES = "366" RPL_MOTD = "372" RPL_MOTDSTART = "375" RPL_ENDOFMOTD = "376" ERR_NICKNAMEINUSE = "433" ERR_BANNICKCHANGE = "437" )
View Source
const (
IRC_VERSION = "go-irc"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Password string TLSConfig *tls.Config DefaultHandler func(*Event) // contains filtered or unexported fields }
func (*Client) Disconnect ¶
func (c *Client) Disconnect()
Disconnect sends all buffered messages (if possible), stops all goroutines and then closes the socket.
func (*Client) SetHandler ¶
type Event ¶
type Event struct { Raw string // raw message line received. contains all of the following information Source string // <nick>!<usr>@<host> Nick string // <nick> User string // <usr> Host string // <host> Code string // PING/PONG ... Arguments []string // arguments to Code Message string // message after " :" }
Click to show internal directories.
Click to hide internal directories.