Documentation ¶
Index ¶
- Constants
- Variables
- func GetToLowerFunc(casemapping string) func(string) string
- func NewClient(svc *service.Service, addr, nick, pass string, values stdchat.ValuesInfo) (service.Networker, error)
- func NewService(tp service.Transporter) *service.Service
- func ToLowerASCII(s string) string
- func ToLowerRFC1459(s string) string
- func ToLowerStrictRFC1459(s string) string
- type Channel
- type Client
- func (client *Client) BreakConnection() error
- func (client *Client) Close() error
- func (client *Client) Closed() bool
- func (client *Client) CmdHandler(msg *stdchat.CmdMsg)
- func (client *Client) ConnID() string
- func (client *Client) Connected() bool
- func (client *Client) Context() context.Context
- func (client *Client) GetChannel(name string) *Channel
- func (client *Client) GetChannels() []*Channel
- func (client *Client) GetNickPrefix(ch byte) byte
- func (client *Client) GetPrefix() (modes string, chars string)
- func (client *Client) GetStateInfo() service.ClientStateInfo
- func (client *Client) Handler(msg *stdchat.ChatMsg)
- func (client *Client) IsChanType(ch byte) bool
- func (client *Client) IsNickPrefix(ch byte) bool
- func (client *Client) Join(joinArgs string) error
- func (client *Client) Logout(reason string) error
- func (client *Client) NetworkID() string
- func (client *Client) NetworkName() string
- func (client *Client) Nick() string
- func (client *Client) NickID() string
- func (client *Client) Ready() bool
- func (client *Client) SendAction(dest, msg string) error
- func (client *Client) SendCTCP(dest, ctcp, args string) error
- func (client *Client) SendCTCPReply(dest, ctcp, args string) error
- func (client *Client) SendLine(line string) error
- func (client *Client) SendMsg(dest, msg string) error
- func (client *Client) SendNotice(dest, notice string) error
- func (client *Client) SetNick(nick string)
- func (client *Client) Start(ctx context.Context, id string) error
- func (client *Client) StringToLower(s string) string
- func (client *Client) TrySendLine(line string) error
- type Member
Constants ¶
const Protocol = "irc"
const ServerTimeFormat = "2006-01-02T15:04:05.999Z07:00"
ServerTimeFormat is the time format of the server-time CAP. The time must be in UTC. ISO 8601: YYYY-MM-DDThh:mm:ss.sssZ
Variables ¶
var ERR_ALREADYREGISTRED = "462"
var ERR_BADCHANMASK = "476"
var ERR_BADCHANNELKEY = "475"
var ERR_BADMASK = "415"
var ERR_BANLISTFULL = "478"
var ERR_BANNEDFROMCHAN = "474"
var ERR_CANNOTSENDTOCHAN = "404"
var ERR_CANTKILLSERVER = "483"
var ERR_CHANNELISFULL = "471"
var ERR_CHANOPRIVSNEEDED = "482"
var ERR_ERRONEUSNICKNAME = "432"
var ERR_FILEERROR = "424"
var ERR_INVITEONLYCHAN = "473"
var ERR_KEYSET = "467"
var ERR_NEEDMOREPARAMS = "461"
var ERR_NICKCOLLISION = "436"
var ERR_NICKNAMEINUSE = "433"
var ERR_NOADMININFO = "423"
var ERR_NOCHANMODES = "477"
var ERR_NOLOGIN = "444"
var ERR_NOMOTD = "422"
var ERR_NONICKNAMEGIVEN = "431"
var ERR_NOOPERHOST = "491"
var ERR_NOORIGIN = "409"
var ERR_NOPERMFORHOST = "463"
var ERR_NOPRIVILEGES = "481"
var ERR_NORECIPIENT = "411"
var ERR_NOSERVICEHOST = "492"
var ERR_NOSUCHCHANNEL = "403"
var ERR_NOSUCHNICK = "401"
var ERR_NOSUCHSERVER = "402"
var ERR_NOSUCHSERVICE = "408"
var ERR_NOTEXTTOSEND = "412"
var ERR_NOTONCHANNEL = "442"
var ERR_NOTOPLEVEL = "413"
var ERR_NOTREGISTERED = "451"
var ERR_PASSWDMISMATCH = "464"
var ERR_RESTRICTED = "484"
var ERR_SUMMONDISABLED = "445"
var ERR_TOOMANYCHANNELS = "405"
var ERR_TOOMANYTARGETS = "407"
var ERR_UMODEUNKNOWNFLAG = "501"
var ERR_UNAVAILRESOURCE = "437"
var ERR_UNIQOPPRIVSNEEDED = "485"
var ERR_UNKNOWNCOMMAND = "421"
var ERR_UNKNOWNMODE = "472"
var ERR_USERNOTINCHANNEL = "441"
var ERR_USERONCHANNEL = "443"
var ERR_USERSDISABLED = "446"
var ERR_USERSDONTMATCH = "502"
var ERR_WASNOSUCHNICK = "406"
var ERR_WILDTOPLEVEL = "414"
var ERR_YOUREBANNEDCREEP = "465"
var ERR_YOUWILLBEBANNED = "466"
var ErrSendQueueFull = errors.New("send queue full")
var RPL_ADMINEMAIL = "259"
var RPL_ADMINLOC1 = "257"
var RPL_ADMINLOC2 = "258"
var RPL_ADMINME = "256"
var RPL_AWAY = "301"
var RPL_BANLIST = "367"
var RPL_BOUNCE = "005"
var RPL_CHANNELMODEIS = "324"
var RPL_CLOSEEND = "363"
var RPL_CLOSING = "362"
var RPL_CREATED = "003"
var RPL_ENDOFBANLIST = "368"
var RPL_ENDOFEXCEPTLIST = "349"
var RPL_ENDOFINFO = "374"
var RPL_ENDOFINVITELIST = "347"
var RPL_ENDOFLINKS = "365"
var RPL_ENDOFMOTD = "376"
var RPL_ENDOFNAMES = "366"
var RPL_ENDOFSERVICES = "232"
var RPL_ENDOFSTATS = "219"
var RPL_ENDOFUSERS = "394"
var RPL_ENDOFWHO = "315"
var RPL_ENDOFWHOIS = "318"
var RPL_ENDOFWHOWAS = "369"
var RPL_EXCEPTLIST = "348"
var RPL_INFO = "371"
var RPL_INFOSTART = "373"
var RPL_INVITELIST = "346"
var RPL_INVITING = "341"
var RPL_ISON = "303"
var RPL_ISUPPORT = "005"
var RPL_KILLDONE = "361"
var RPL_LINKS = "364"
var RPL_LIST = "322"
var RPL_LISTEND = "323"
var RPL_LISTSTART = "321"
var RPL_LUSERCHANNELS = "254"
var RPL_LUSERCLIENT = "251"
var RPL_LUSERME = "255"
var RPL_LUSEROP = "252"
var RPL_LUSERUNKNOWN = "253"
var RPL_MOTD = "372"
var RPL_MOTDSTART = "375"
var RPL_MYINFO = "004"
var RPL_MYPORTIS = "384"
var RPL_NAMREPLY = "353"
var RPL_NONE = "300"
var RPL_NOTOPIC = "331"
var RPL_NOUSERS = "395"
var RPL_NOWAWAY = "306"
var RPL_REHASHING = "382"
var RPL_SERVICE = "233"
var RPL_SERVICEINFO = "231"
var RPL_SERVLIST = "234"
var RPL_SERVLISTEND = "235"
var RPL_STATSBLINE = "247"
var RPL_STATSCLINE = "213"
var RPL_STATSCOMMANDS = "212"
var RPL_STATSDLINE = "250"
var RPL_STATSHLINE = "244"
var RPL_STATSILINE = "215"
var RPL_STATSKLINE = "216"
var RPL_STATSLINKINFO = "211"
var RPL_STATSLLINE = "241"
var RPL_STATSNLINE = "214"
var RPL_STATSOLINE = "243"
var RPL_STATSPING = "246"
var RPL_STATSQLINE = "217"
var RPL_STATSSLINE = "244"
var RPL_STATSUPTIME = "242"
var RPL_STATSVLINE = "240"
var RPL_STATSYLINE = "218"
var RPL_SUMMONING = "342"
var RPL_TIME = "391"
var RPL_TOPIC = "332"
var RPL_TRACECLASS = "209"
var RPL_TRACECONNECTING = "201"
var RPL_TRACEEND = "262"
var RPL_TRACEHANDSHAKE = "202"
var RPL_TRACELINK = "200"
var RPL_TRACELOG = "261"
var RPL_TRACENEWTYPE = "208"
var RPL_TRACEOPERATOR = "204"
var RPL_TRACERECONNECT = "210"
var RPL_TRACESERVER = "206"
var RPL_TRACESERVICE = "207"
var RPL_TRACEUNKNOWN = "203"
var RPL_TRACEUSER = "205"
var RPL_TRYAGAIN = "263"
var RPL_UMODEIS = "221"
var RPL_UNAWAY = "305"
var RPL_UNIQOPIS = "325"
var RPL_USERHOST = "302"
var RPL_USERS = "393"
var RPL_USERSSTART = "392"
var RPL_VERSION = "351"
var RPL_WELCOME = "001"
var RPL_WHOISCHANNELS = "319"
var RPL_WHOISCHANOP = "316"
var RPL_WHOISIDLE = "317"
var RPL_WHOISOPERATOR = "313"
var RPL_WHOISSERVER = "312"
var RPL_WHOISUSER = "311"
var RPL_WHOREPLY = "352"
var RPL_WHOWASUSER = "314"
var RPL_YOUREOPER = "381"
var RPL_YOURESERVICE = "383"
var RPL_YOURHOST = "002"
Functions ¶
func GetToLowerFunc ¶
func NewService ¶
func NewService(tp service.Transporter) *service.Service
func ToLowerASCII ¶
func ToLowerRFC1459 ¶
func ToLowerStrictRFC1459 ¶
Types ¶
type Channel ¶
type Channel struct {
// contains filtered or unexported fields
}
func (*Channel) GetMembersInfo ¶
func (channel *Channel) GetMembersInfo() []stdchat.MemberInfo
func (*Channel) GetStateInfo ¶
func (channel *Channel) GetStateInfo() stdchat.SubscriptionStateInfo
type Client ¶
type Client struct { Verbose bool // verbose output to log.Print/Printf // contains filtered or unexported fields }
func (*Client) BreakConnection ¶
BreakConnection will force break the connection, as if there was a network error. A broken connection will auto-reconnect; use Close() for proper connection close.
func (*Client) CmdHandler ¶
func (client *Client) CmdHandler(msg *stdchat.CmdMsg)
func (*Client) GetChannel ¶
GetChannel gets a channel this user is on, or nil if not.
func (*Client) GetChannels ¶
func (*Client) GetNickPrefix ¶
Returns 0 if ch is not a channel nick prefix mode.
func (*Client) GetStateInfo ¶
func (client *Client) GetStateInfo() service.ClientStateInfo
func (*Client) IsChanType ¶
func (*Client) IsNickPrefix ¶
func (*Client) Logout ¶
Logout and Close. This is needed to release resources, stop goroutines, and remove from the service clients list.
func (*Client) NetworkName ¶
func (*Client) Nick ¶
Nick gets your current nickname, which can be empty before or during a connection. Note that reading the Nick() may return the old nickname until updated by the server.
func (*Client) SendAction ¶
func (*Client) SendCTCPReply ¶
func (*Client) SendLine ¶
SendLine queues up the line to be sent eventually, after considering rate limiting. Note that if the queue fills up, the call blocks; use TrySendLine to avoid this. An error can be returned when the connection is closed.
func (*Client) SendNotice ¶
func (*Client) StringToLower ¶
StringToLower converts s to lowercase per the server's casemapping.
func (*Client) TrySendLine ¶
TrySendLine is similar to SendLine, but will return ErrSendQueueFull immediately if the send queue is full.