irc

package module
v0.0.0-...-bcf3223 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2015 License: MIT Imports: 4 Imported by: 0

README

IRC
===


IRC is tiny IRC client library. For an example application, see the examples_
directory.

* how to use irc: rfc1459_ and rfc2812_
* API documentation_


.. _examples: https://github.com/husio/go-irc/tree/master/examples
.. _rfc1459: http://tools.ietf.org/html/rfc1459
.. _rfc2812: https://tools.ietf.org/html/rfc2812
.. _documentation: http://godoc.org/github.com/husio/irc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

Conn represents single server connection client.

func Connect

func Connect(addr string) (*Conn, error)

Connect return client connected to given address.

func (*Conn) Close

func (c *Conn) Close() error

Close connection to server

func (*Conn) ReadMessage

func (c *Conn) ReadMessage() (*Message, error)

ReadMessage reads line from server and return parsing result.

func (*Conn) Send

func (c *Conn) Send(format string, args ...interface{}) error

Send writes message to connected server.

Because every message has to end with \r\n, if given format string do not end this way, those two character are written additionally.

type Message

type Message struct {
	Raw      string
	Prefix   string
	Command  string
	Params   []string
	Trailing string
}

IRC message format:

:<prefix> <command> <params> :<trailing>

func ParseLine

func ParseLine(raw string) (*Message, error)

ParseLine return Message created from parsing given line.

func (*Message) Nick

func (m *Message) Nick() string

Nick return author nickname or empty string if cannot be determined.

func (*Message) String

func (m *Message) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL