irc

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ASCII maps a-z as the lower case of A-Z
	ASCII = "ascii"
	// RFC1459 maps a-z and {, |, }, ~ as the lower case of A-Z and [, \, ], ^
	RFC1459 = "rfc1459"
	// RFC1459Strict maps a-z and {, |, } as the lower case of A-Z and [, \, ]
	RFC1459Strict = "strict-rfc1459"
)
View Source
const (
	Error   = "ERROR"
	Join    = "JOIN"
	Mode    = "MODE"
	Nick    = "NICK"
	Notice  = "NOTICE"
	Part    = "PART"
	Ping    = "PING"
	Privmsg = "PRIVMSG"
	Quit    = "QUIT"
	Topic   = "TOPIC"

	ReplyWelcome         = "001"
	ReplyYourHost        = "002"
	ReplyCreated         = "003"
	ReplyISupport        = "005"
	ReplyLUserClient     = "251"
	ReplyLUserOp         = "252"
	ReplyLUserUnknown    = "253"
	ReplyLUserChannels   = "254"
	ReplyLUserMe         = "255"
	ReplyAway            = "301"
	ReplyWhoisUser       = "311"
	ReplyWhoisServer     = "312"
	ReplyWhoisOperator   = "313"
	ReplyWhoisIdle       = "317"
	ReplyEndOfWhois      = "318"
	ReplyWhoisChannels   = "319"
	ReplyList            = "322"
	ReplyListEnd         = "323"
	ReplyNoTopic         = "331"
	ReplyTopic           = "332"
	ReplyNamReply        = "353"
	ReplyEndOfNames      = "366"
	ReplyMotd            = "372"
	ReplyMotdStart       = "375"
	ReplyEndOfMotd       = "376"
	ErrErroneousNickname = "432"
	ErrNicknameInUse     = "433"
	ErrForward           = "470"
)

Variables

View Source
var (
	ErrBadProtocol = errors.New("This server does not speak IRC")
)

Functions

func Casefold added in v0.6.1

func Casefold(mapping, s string) string

func EqualFold added in v0.6.1

func EqualFold(mapping, s1, s2 string) bool

Types

type Client

type Client struct {
	Server          string
	Host            string
	TLS             bool
	TLSConfig       *tls.Config
	Password        string
	Username        string
	Realname        string
	HandleNickInUse func(string) string

	Messages          chan *Message
	ConnectionChanged chan ConnectionState
	Features          *Features
	// contains filtered or unexported fields
}

func NewClient

func NewClient(nick, username string) *Client

func (*Client) Away

func (c *Client) Away(message string)

func (*Client) Casefold added in v0.6.1

func (c *Client) Casefold(s string) string

func (*Client) Connect

func (c *Client) Connect(address string)

func (*Client) Connected

func (c *Client) Connected() bool

func (*Client) EqualFold added in v0.6.1

func (c *Client) EqualFold(s1, s2 string) bool

func (*Client) GetNick

func (c *Client) GetNick() string

func (*Client) Invite

func (c *Client) Invite(nick, channel string)

func (*Client) Join

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

func (*Client) Kick

func (c *Client) Kick(channel string, users ...string)

func (*Client) List added in v0.6.1

func (c *Client) List()

func (*Client) Mode

func (c *Client) Mode(target, modes, params string)

func (*Client) Nick

func (c *Client) Nick(nick string)

func (*Client) Notice

func (c *Client) Notice(target, msg string)

func (*Client) Oper

func (c *Client) Oper(name, password string)

func (*Client) Part

func (c *Client) Part(channels ...string)

func (*Client) Privmsg

func (c *Client) Privmsg(target, msg string)

func (*Client) Quit

func (c *Client) Quit()

func (*Client) Reconnect

func (c *Client) Reconnect()

func (*Client) Registered

func (c *Client) Registered() bool

func (*Client) Topic

func (c *Client) Topic(channel string, topic ...string)

func (*Client) Whois

func (c *Client) Whois(nick string)

func (*Client) Write

func (c *Client) Write(data string)

func (*Client) Writef

func (c *Client) Writef(format string, a ...interface{})

type ConnectionState

type ConnectionState struct {
	Connected bool
	Error     error
}

type Features added in v0.6.1

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

func NewFeatures added in v0.6.1

func NewFeatures() *Features

func (*Features) Get added in v0.6.1

func (f *Features) Get(key string) interface{}

func (*Features) Has added in v0.6.1

func (f *Features) Has(key string) bool

func (*Features) Int added in v0.6.1

func (f *Features) Int(key string) int

func (*Features) Map added in v0.6.1

func (f *Features) Map() map[string]interface{}

func (*Features) Parse added in v0.6.1

func (f *Features) Parse(params []string)

func (*Features) String added in v0.6.1

func (f *Features) String(key string) string

type Message

type Message struct {
	Tags    map[string]string
	Prefix  string
	Nick    string
	Command string
	Params  []string
}

func ParseMessage added in v0.6.1

func ParseMessage(line string) *Message

func (*Message) LastParam

func (m *Message) LastParam() string

Jump to

Keyboard shortcuts

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