struc

package
v0.0.0-...-390139f Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2013 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ADMIN = iota
	AWAY
	CONNECT
	DIE
	ERROR
	INFO
	INVITE
	ISON
	JOIN
	KICK
	KILL
	LINKS
	LIST
	LUSERS
	MODE
	MOTD
	NAMES
	NICK
	NJOIN
	NOTICE
	OPER
	PART
	PASS
	PING
	PONG
	PRIVMSG
	QUIT
	REHASH
	RESTART
	SERVER
	SERVICE
	SERVLIST
	SQUERY
	SQUIRT
	SQUIT
	STATS
	SUMMON
	TIME
	TOPIC
	TRACE
	USER
	USERHOST
	USERS
	VERSION
	WALLOPS
	WHO
	WHOIS
	WHOWAS
)

Define the command types (good god there are a lot of these!)

Variables

View Source
var Commands = []string{
	"ADMIN",
	"AWAY",
	"CONNECT",
	"DIE",
	"ERROR",
	"INFO",
	"INVITE",
	"ISON",
	"JOIN",
	"KICK",
	"KILL",
	"LINKS",
	"LIST",
	"LUSERS",
	"MODE",
	"MOTD",
	"NAMES",
	"NICK",
	"NJOIN",
	"NOTICE",
	"OPER",
	"PART",
	"PASS",
	"PING",
	"PONG",
	"PRIVMSG",
	"QUIT",
	"REHASH",
	"RESTART",
	"SERVER",
	"SERVICE",
	"SERVLIST",
	"SQUERY",
	"SQUIRT",
	"SQUIT",
	"STATS",
	"SUMMON",
	"TIME",
	"TOPIC",
	"TRACE",
	"USER",
	"USERHOST",
	"USERS",
	"VERSION",
	"WALLOPS",
	"WHO",
	"WHOIS",
	"WHOWAS",
}

Commands defines the commands in string form. The use of iota above means the constants provide indices into this array.

Functions

This section is empty.

Types

type IRCMessage

type IRCMessage struct {
	Prefix       string   // With the colon removed.
	Response     bool     // Whether this is a response or a command.
	Command      int      // This or ResponseCode will be set, but not both.
	ResponseCode string   // This must be a string to ensure that 001 stays 001.
	Arguments    []string // Arbitrary number of arguments to any command.
	Trailing     string   // Anything that comes after the final colon in an IRC message.
}

IRCMessage structure represents a parsed IRC message. These are used internally rather than byte buffers.

func NewIRCMessage

func NewIRCMessage() *IRCMessage

NewIRCMEssage builds and initialises a new IRC message.

type IRCServer

type IRCServer struct {
	IPAddr net.IP
	Port   uint64
	Name   string
}

Represents a single IRC server. Currently there should be only one of these in a running instance of GoBot, or it will get very confused.

func NewIRCServerFromHostnamePort

func NewIRCServerFromHostnamePort(hostnameAndPort string) (*IRCServer, error)

NewIRCServerFromHostnamePort creates a new IRCServer structure given a hostname-and-port string.

Jump to

Keyboard shortcuts

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