irc

package module
v0.0.0-...-26182ce Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2015 License: MIT Imports: 7 Imported by: 0

README

irc

An implementation of the IRC protocol (not finished)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMsgTooLong = errors.New("irc: message longer than 510 characters")
View Source
var ErrMsgTooShort = errors.New("irc: message too short")
View Source
var ErrParamsTooLong = errors.New("irc: more than 15 parameters")

Functions

This section is empty.

Types

type Client

type Client struct {
	io.ReadWriteCloser
}

func NewClient

func NewClient(r io.ReadWriteCloser) (c Client)

func (Client) Command

func (c Client) Command(command string, params ...string) error

func (Client) Join

func (c Client) Join(channels ...string) error

func (Client) JoinLockedChannel

func (c Client) JoinLockedChannel(channel, password string) error

func (Client) Nick

func (c Client) Nick(name string) error

func (Client) Pass

func (c Client) Pass(password string) error

func (Client) SendMessage

func (c Client) SendMessage(m Message) (err error)

type Message

type Message struct {
	Prefix  string
	Command string
	Params  []string //up to 15
}

Message represents a single IRC message, such as this:

:prefix command parameter1 param2 param3

func (Message) Encode

func (m Message) Encode(w io.Writer) (err error)

func (Message) MarshalText

func (m Message) MarshalText() (b []byte, err error)

func (*Message) UnmarshalText

func (m *Message) UnmarshalText(b []byte) (err error)

UnmarshalText parses the IRC message into the Message struct.

type MessageDecoder

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

func NewMessageDecoder

func NewMessageDecoder(r io.Reader) (m MessageDecoder)

func (MessageDecoder) Decode

func (d MessageDecoder) Decode() (m Message, err error)

Directories

Path Synopsis
internal
util
Package util provides some helpful functions.
Package util provides some helpful functions.

Jump to

Keyboard shortcuts

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