Documentation
¶
Index ¶
- type Client
- func (c *Client) Connect() error
- func (c *Client) GetNick() string
- func (c *Client) Handle(event string, fn func(m *Message))
- func (c *Client) Mode(channel, mode, target string) error
- func (c *Client) Nick(nick string) error
- func (c *Client) Notice(target, message string) error
- func (c *Client) Noticef(target, format string, args ...interface{}) error
- func (c *Client) Privmsg(target, message string) error
- func (c *Client) Privmsgf(target, format string, args ...interface{}) error
- func (c *Client) Quit(message string)
- func (c *Client) ReclaimNick()
- func (c *Client) Sendf(format string, args ...interface{}) error
- func (c *Client) Whois(nick string) error
- type Message
- type Option
- func WithAddr(addr string) Option
- func WithChannel(ch string) Option
- func WithConn(conn net.Conn) Option
- func WithDebug() Option
- func WithLogger(logger *log.Logger) Option
- func WithNick(n string) Option
- func WithPostConnectMessage(t, m string) Option
- func WithPostConnectMode(m string) Option
- func WithRealName(r string) Option
- func WithUser(u string) Option
- func WithVersion(v string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client contains the IRC client
type Message ¶
type Message struct { // Raw contains the unparsed message Raw string // Command contains a three digit number or a string Command string // Params is filled with all parameters that the message contains Params string // ParamsArray is equal to Params, but are splitted on space for easier manipulation ParamsArray []string // Name is an optional field, if it contains data it holds either the server name or a nick Name string // User is an optional parameter that contains the user if the message originates from a client User string // Host is also an optional parameter that contains the host if the message originates from a client Host string }
Message represents the RFC1459 definition of an IRC message See the full definition in section 2.3.1 in the RFC
type Option ¶
type Option func(*Client)
Option should be implemented by all client options
func WithAddr ¶
WithAddr sets the address of the IRC server, this can be omitted if you supply a connection with WithConn
func WithChannel ¶
WithChannel sets the channel that the client should join on connect, this can be called mupltiple times
func WithConn ¶
WithConn sets the client connection, this can be omitted if you supply an address with WithAddr
func WithDebug ¶
func WithDebug() Option
WithDebug sets the debug flag, set this if you want to log the communication
func WithPostConnectMessage ¶ added in v1.2.0
func WithPostConnectMode ¶ added in v1.3.0
func WithRealName ¶
WithRealName sets the real name for the client
Source Files
¶
Click to show internal directories.
Click to hide internal directories.