Versions in this module Expand all Collapse all v0 v0.0.1 Feb 22, 2022 Changes in this version + const CTCPAction + const CTCPClientInfoQuery + const CTCPClientInfoReply + const CTCPPingQuery + const CTCPPingReply + const CTCPTimeQuery + const CTCPTimeReply + const CTCPVersionQuery + const CTCPVersionReply + const CmdAdmin + const CmdAway + const CmdCap + const CmdConnect + const CmdDie + const CmdError + const CmdInfo + const CmdInvite + const CmdIsOn + const CmdJoin + const CmdKick + const CmdKill + const CmdLUsers + const CmdLinks + const CmdList + const CmdMOTD + const CmdMode + const CmdNJoin + const CmdNames + const CmdNick + const CmdNotice + const CmdOper + const CmdPart + const CmdPass + const CmdPing + const CmdPong + const CmdPrivmsg + const CmdQuit + const CmdRehash + const CmdRestart + const CmdSQuery + const CmdSQuit + const CmdServList + const CmdServer + const CmdService + const CmdStats + const CmdTagMsg + const CmdTime + const CmdTopic + const CmdTrace + const CmdUser + const CmdUserHost + const CmdUsers + const CmdVersion + const CmdWAllOps + const CmdWho + const CmdWhoIs + const CmdWhoWas + const RplAdminEmail + const RplAdminLoc1 + const RplAdminLoc2 + const RplAdminMe + const RplAway + const RplBanList + const RplBounce + const RplChannelModeIs + const RplCreated + const RplEndOfBanList + const RplEndOfExceptList + const RplEndOfInfo + const RplEndOfInviteList + const RplEndOfLinks + const RplEndOfMOTD + const RplEndOfNames + const RplEndOfStats + const RplEndOfUsers + const RplEndOfWho + const RplEndOfWhoIs + const RplEndOfWhoWas + const RplErrAlreadyRegistered + const RplErrBadChanMask + const RplErrBadChannelKey + const RplErrBadMask + const RplErrBanListFull + const RplErrBannedFromChan + const RplErrCannotSendToChan + const RplErrCantKillServer + const RplErrChanOPrivsNeeded + const RplErrChannelIsFull + const RplErrErroneousNickname + const RplErrFileError + const RplErrInvalidCapCmd + const RplErrInviteOnlyChan + const RplErrKeySet + const RplErrNeedMoreParams + const RplErrNickCollision + const RplErrNicknameInUse + const RplErrNoAdminInfo + const RplErrNoChanModes + const RplErrNoLogin + const RplErrNoMOTD + const RplErrNoNicknameGiven + const RplErrNoOperHost + const RplErrNoOrigin + const RplErrNoPermForHost + const RplErrNoPrivileges + const RplErrNoRecipient + const RplErrNoSuchChannel + const RplErrNoSuchNick + const RplErrNoSuchServer + const RplErrNoSuchService + const RplErrNoTextToSend + const RplErrNoToplevel + const RplErrNotOnChannel + const RplErrNotRegistered + const RplErrPasswdMismatch + const RplErrRestricted + const RplErrSummonDisabled + const RplErrTooManyChannels + const RplErrTooManyTargets + const RplErrUModeUnknownFlag + const RplErrUnavailResource + const RplErrUniqOPrivsNeeded + const RplErrUnknownCommand + const RplErrUnknownMode + const RplErrUserNotInChannel + const RplErrUserOnChannel + const RplErrUsersDisabled + const RplErrUsersDontMatch + const RplErrWasNoSuchNick + const RplErrWildToplevel + const RplErrYouWillBeBanned + const RplErrYoureBannedCreep + const RplExceptList + const RplHostHidden + const RplISupport + const RplInfo + const RplInviteList + const RplInviting + const RplIsOn + const RplLUserChannels + const RplLUserClient + const RplLUserMe + const RplLUserOp + const RplLUserUknownL + const RplLinks + const RplList + const RplListEnd + const RplListStart + const RplMOTD + const RplMOTDStart + const RplMyInfo + const RplNamReply + const RplNoTopic + const RplNoUsers + const RplNowAway + const RplRehashing + const RplServList + const RplServListEnd + const RplStatsCommands + const RplStatsLinkInfo + const RplStatsOLine + const RplStatsUptime + const RplSummoning + const RplTime + const RplTopic + const RplTraceClass + const RplTraceConnecting + const RplTraceEnd + const RplTraceHandshake + const RplTraceLink + const RplTraceLog + const RplTraceNewtype + const RplTraceOperator + const RplTraceReconnect + const RplTraceServer + const RplTraceService + const RplTraceUnknown + const RplTraceUser + const RplTryAgain + const RplUModeIs + const RplUnAway + const RplUniqOpIs + const RplUserHost + const RplUsers + const RplUsersStart + const RplVersion + const RplWelcome + const RplWhoIsChannels + const RplWhoIsIdle + const RplWhoIsOperator + const RplWhoIsServer + const RplWhoIsUser + const RplWhoReply + const RplWhoWasUser + const RplWhoisBot + const RplYourHost + const RplYoureOper + const RplYoureService + type Client struct + Addr string + DialFn func() (io.ReadWriteCloser, error) + ErrorLog *log.Logger + Nickname string + Pass string + Realname string + User string + func (c *Client) ConnectAndRun(ctx context.Context, h Handler) error + func (c *Client) Nick() Nickname + func (c *Client) WriteMessage(m encoding.TextMarshaler) + type Command string + func NewCTCPCmd(subcommand string) Command + func NewCTCPReplyCmd(subcommand string) Command + func (c Command) String() string + type Handler interface + SpeakIRC func(MessageWriter, *Message) + type HandlerFunc func(MessageWriter, *Message) + func (f HandlerFunc) SpeakIRC(w MessageWriter, m *Message) + type Message struct + Command Command + Params Params + Source Prefix + Tags Tags + func CTCP(target, command, message string) *Message + func CTCPReply(target, command, message string) *Message + func Cap(args ...string) *Message + func CapEnd() *Message + func CapLS(version string) *Message + func CapList() *Message + func CapReq(cap string) *Message + func Describe(target, action string) *Message + func Invite(nick, channel string) *Message + func Join(channel string) *Message + func JoinWithKey(channel, key string) *Message + func Kick(channel, nick string) *Message + func KickWithReason(channel, nick, reason string) *Message + func Mode(target, flag, flagParam string) *Message + func ModeQuery(target string) *Message + func Msg(target, message string) *Message + func NewMessage(cmd Command, args ...string) *Message + func Nick(name string) *Message + func Notice(target, message string) *Message + func Part(channel string) *Message + func PartAll() *Message + func PartWithReason(channel, reason string) *Message + func Pass(password string) *Message + func Ping(message string) *Message + func Pong(reply string) *Message + func Quit(message string) *Message + func TagMsg(tags map[string]string) *Message + func User(user, realname string) *Message + func (m *Message) Chan() (string, error) + func (m *Message) IncludePrefix() + func (m *Message) MarshalText() ([]byte, error) + func (m *Message) Target() (string, error) + func (m *Message) Text() (string, error) + func (m *Message) UnmarshalText(text []byte) error + type MessageWriter interface + WriteMessage func(encoding.TextMarshaler) + type Nickname string + func (n Nickname) Is(other string) bool + func (n Nickname) String() string + type Params []string + func (p Params) Get(n int) string + type Prefix struct + Host string + Nick Nickname + User string + func (p Prefix) IsServer() bool + func (p Prefix) String() string + type Router struct + func (r *Router) Handle(cmd Command, h Handler) *route + func (r *Router) HandleFunc(cmd Command, f HandlerFunc) *route + func (r *Router) OnAction(wildtext string, h HandlerFunc) *route + func (r *Router) OnCTCP(subcommand string, h HandlerFunc) *route + func (r *Router) OnCTCPReply(subcommand string, h HandlerFunc) *route + func (r *Router) OnConnect(h HandlerFunc) *route + func (r *Router) OnError(h HandlerFunc) *route + func (r *Router) OnJoin(h HandlerFunc) *route + func (r *Router) OnNick(h func(nick Nickname, newnick Nickname)) *route + func (r *Router) OnNotice(wildtext string, h HandlerFunc) *route + func (r *Router) OnOp(h HandlerFunc) *route + func (r *Router) OnPart(h HandlerFunc) *route + func (r *Router) OnQuit(h HandlerFunc) *route + func (r *Router) OnText(wildtext string, h HandlerFunc) *route + func (r *Router) OnTextRE(expr string, h HandlerFunc) *route + func (r *Router) SpeakIRC(mw MessageWriter, m *Message) + func (r *Router) Use(middlewares ...middleware) + type Tags map[string]string + func (t *Tags) Set(k string, v string) + func (t Tags) Get(key string) string + func (t Tags) Has(key string) bool v0.0.0 Feb 22, 2022