Documentation
¶
Overview ¶
IRC server
Index ¶
- Constants
- func ERR_BADCHANNELKEY(nick, channel string) string
- func ERR_BANNEDFROMCHAN(nick, channel string) string
- func ERR_CHANOPRIVSNEEDED(nick, channel string) string
- func ERR_ERRONEUSNICKNAME(nick, badNick string) string
- func ERR_NEEDMOREPARAMS(nick, command string) string
- func ERR_NICKCOLLISION(nick string) string
- func ERR_NICKNAMEINUSE(currentNick, desiredNick string) string
- func ERR_NOPRIVILEGES(nick string) string
- func ERR_NOSUCHCHANNEL(nick, channel string) string
- func ERR_NOSUCHNICK(nick, nonExistant string) string
- func ERR_NOSUCHSERVER(nick, nonExistant string) string
- func ERR_NOTONCHANNEL(nick, channel string) string
- func ERR_PASSWDMISMATCH(nick string) string
- func ERR_TOOMANYTARGETS(nick, someClue string) string
- func ERR_UMODEUNKNOWNFLAG(nick string) string
- func ERR_UNKNOWNMODE(nick, channel string, badMode string) string
- func ERR_USERNOTINCHANNEL(nick, notPresent, channel string) string
- func ERR_USERSDONTMATCH(nick string) string
- func ERR_WASNOSUCHNICK(nick, target string) string
- func JOIN(nick, channel string) string
- func KICK(nick, douchebag, channel, reason string) string
- func MODE(nick, target, modeString string) string
- func NICK(oldNick, newNick string) string
- func PART(nick, channel string) string
- func PRIVMSG(from, to, message string) string
- func RPL_BANLIST(nick, channel, banMask string) string
- func RPL_CHANNELMODEIS(nick, channel, modeString string) string
- func RPL_CREATED(nick string) string
- func RPL_ENDOFBANLIST(nick, channel string) string
- func RPL_ENDOFEXCEPTLIST(nick, channel string) string
- func RPL_ENDOFINFO(nick string) string
- func RPL_ENDOFINVITELIST(nick, channel string) string
- func RPL_ENDOFMOTD(nick string) string
- func RPL_ENDOFNAMES(nick, channel string) string
- func RPL_ENDOFWHO(nick, itemName string) string
- func RPL_ENDOFWHOIS(nick, target string) string
- func RPL_EXCEPTLIST(nick, channel, exceptionMask string) string
- func RPL_INFO(nick string) string
- func RPL_INVITELIST(nick, channel, inviteMask string) string
- func RPL_LIST(nick, channel, topic string, numVisible int) string
- func RPL_LISTEND(nick string) string
- func RPL_MAYBETOPIC(nick, channel, topic string) string
- func RPL_MOTD(nick string) string
- func RPL_MOTDSTART(nick string) string
- func RPL_MYINFO(nick string) string
- func RPL_NAMREPLY(nick, channel string, nicknames []string) string
- func RPL_NOTOPIC(nick, channel string) string
- func RPL_NOWAWAY(nick string) string
- func RPL_REHASHING(nick string) string
- func RPL_SIMPLEWHOISUSER(nick, target string) string
- func RPL_SIMPLEWHOREPLY(nick, channel, target string, hasOp bool) string
- func RPL_TOPIC(nick, channel, topic string) string
- func RPL_UMODEIS(nick, umode string) string
- func RPL_UNAWAY(nick string) string
- func RPL_VERSION(nick string) string
- func RPL_WELCOME(nick string) string
- func RPL_WHOISUSER(nick, target, user, host, realName string) string
- func RPL_WHOREPLY(nick, channel, user, host, usersServer, target, weirdsymbols, realName string, ...) string
- func RPL_YOUREOPER(nick string) string
- func RPL_YOURHOST(nick string) string
- func StartIRCServer()
- func TOPIC(nick, channel, topic string) string
- type IRCUser
- type NSAddRequest
- type NSDelRequest
- type NSLookupRequest
- type NSReplaceRequest
- type NameSpaceStruct
- type ScanWordsOrCUTObj
- type UserModeUpdate
Constants ¶
const ( TIMEOUT_HANDSHAKE = 60 TIMEOUT_PING = 5 * 60 TIMEOUT_PONG = 3 * 60 )
Variables ¶
This section is empty.
Functions ¶
func ERR_BADCHANNELKEY ¶
func ERR_BANNEDFROMCHAN ¶
func ERR_CHANOPRIVSNEEDED ¶
func ERR_ERRONEUSNICKNAME ¶
func ERR_NEEDMOREPARAMS ¶
func ERR_NICKCOLLISION ¶
func ERR_NICKNAMEINUSE ¶
func ERR_NOPRIVILEGES ¶
func ERR_NOSUCHCHANNEL ¶
func ERR_NOSUCHNICK ¶
func ERR_NOSUCHSERVER ¶
func ERR_NOTONCHANNEL ¶
func ERR_PASSWDMISMATCH ¶
func ERR_TOOMANYTARGETS ¶
func ERR_UMODEUNKNOWNFLAG ¶
func ERR_UNKNOWNMODE ¶
func ERR_USERNOTINCHANNEL ¶
func ERR_USERSDONTMATCH ¶
func ERR_WASNOSUCHNICK ¶
func RPL_BANLIST ¶
func RPL_CHANNELMODEIS ¶
func RPL_CREATED ¶
func RPL_ENDOFBANLIST ¶
func RPL_ENDOFEXCEPTLIST ¶
func RPL_ENDOFINFO ¶
func RPL_ENDOFINVITELIST ¶
func RPL_ENDOFMOTD ¶
func RPL_ENDOFNAMES ¶
func RPL_ENDOFWHO ¶
func RPL_ENDOFWHOIS ¶
func RPL_EXCEPTLIST ¶
func RPL_INVITELIST ¶
func RPL_LISTEND ¶
func RPL_MAYBETOPIC ¶
func RPL_MOTDSTART ¶
func RPL_MYINFO ¶
func RPL_NAMREPLY ¶
func RPL_NOTOPIC ¶
func RPL_NOWAWAY ¶
func RPL_REHASHING ¶
func RPL_SIMPLEWHOISUSER ¶
func RPL_SIMPLEWHOREPLY ¶
func RPL_UMODEIS ¶
func RPL_UNAWAY ¶
func RPL_VERSION ¶
func RPL_WELCOME ¶
func RPL_WHOISUSER ¶
func RPL_WHOREPLY ¶
func RPL_YOUREOPER ¶
func RPL_YOURHOST ¶
func StartIRCServer ¶
func StartIRCServer()
Creates a new IRC server. Assumes the presence of a mcxconfig that has been initiated.
Types ¶
type IRCUser ¶
type IRCUser struct { // The Nickname is the username is the pseudonym of the user Nickname string // Connection that is associated with the user. Conn net.Conn // Sending True to this will violently but cleanly disconnect the user Kill chan (bool) // Waitgroup that will block until this IRC user has disconnected or in any // way stopped existing. WaitForDeath sync.WaitGroup // user flags IsOperator bool // The only flag that is used by mcxircd! All other are ignored. Away bool Invisible bool Wallops bool Restricted bool ModeS bool // contains filtered or unexported fields }
Represents an IRC user. This struct contains values that are hidden. You should never write to this structure.
func Handshake ¶
handshake performs handshakes with connecting entities. In theory it figures out if the connecting entity is a user, a server, a service or something else, and creates such an object after the handshake is complete, but right now it can only handle users.
func NewIRCUser ¶
Creates a new IRCUser. Everything written to the net.Conn will be parsed as user IRC commands and replies will be sent back. Returns the datastruct and true if successful.
func (*IRCUser) SendMessage ¶
Implements namedIRCItem
func (*IRCUser) SetSpamProtection ¶
Enables or disables spam protection for this user. Useful for bots that are known to be friendly, and need to handle a lot of users!
type NSAddRequest ¶
type NSDelRequest ¶
type NSLookupRequest ¶
type NSLookupRequest struct { Key string ReplyTo chan (namedIRCItem) }
type NSReplaceRequest ¶
type NameSpaceStruct ¶
type NameSpaceStruct struct { Lookup chan (*NSLookupRequest) Add chan (*NSAddRequest) Del chan (*NSDelRequest) Replace chan (*NSReplaceRequest) Map map[string]namedIRCItem }
var NameSpace NameSpaceStruct
* Namespace is a singleton object that has a map[string]namedIRCItem, that * contains all named items in the known IRC-world. That is, users and channels. * Whenever anything needs to send a message to something else, and it does not * have a direct pointer to use, it looks it up using the namespace. * * Maybe this would be more effective with a mutex. Reads happen a lot more * often, and multiple reads can happen simultaneously. *
type ScanWordsOrCUTObj ¶
type ScanWordsOrCUTObj struct {
// contains filtered or unexported fields
}
func (*ScanWordsOrCUTObj) CUT ¶
func (s *ScanWordsOrCUTObj) CUT() []byte
func (*ScanWordsOrCUTObj) ScanWordsOrCUT ¶
type UserModeUpdate ¶
Can be sent to IRCUser's when others than themselves change their modes. (OPERS or bots for example)