Documentation ¶
Overview ¶
Package xirc contains an extended IRC library.
Index ¶
- Constants
- func FormatServerTime(t time.Time) string
- func GenerateIsupport(tokens []string) []*irc.Message
- func GenerateJoin(channels, keys []string) []*irc.Message
- func GenerateMOTD(motd string) []*irc.Message
- func GenerateMonitor(subcmd string, targets []string) []*irc.Message
- func GenerateNamesReply(channel string, status ChannelStatus, members []string) []*irc.Message
- func GenerateSASL(resp []byte) []*irc.Message
- func GenerateWHOXReply(fields string, info *WHOXInfo) *irc.Message
- func ParseCTCPMessage(msg *irc.Message) (cmd string, params string, ok bool)
- func ParseWHOXOptions(options string) (fields, whoxToken string)
- type CapRegistry
- type CaseMapping
- type CaseMappingMap
- func (cmm *CaseMappingMap[V]) Del(name string)
- func (cmm *CaseMappingMap[V]) ForEach(f func(string, V))
- func (cmm *CaseMappingMap[V]) Get(name string) V
- func (cmm *CaseMappingMap[V]) Has(name string) bool
- func (cmm *CaseMappingMap[V]) Len() int
- func (cmm *CaseMappingMap[V]) Set(name string, value V)
- func (cmm *CaseMappingMap[V]) SetCaseMapping(newCasemap CaseMapping)
- type ChannelStatus
- type Membership
- type MembershipSet
- type WHOXInfo
Constants ¶
View Source
const ( RPL_STATSPING = "246" RPL_LOCALUSERS = "265" RPL_GLOBALUSERS = "266" RPL_WHOISCERTFP = "276" RPL_WHOISREGNICK = "307" RPL_WHOISSPECIAL = "320" RPL_CREATIONTIME = "329" RPL_WHOISACCOUNT = "330" RPL_TOPICWHOTIME = "333" RPL_WHOISACTUALLY = "338" RPL_WHOSPCRPL = "354" RPL_WHOISHOST = "378" RPL_WHOISMODES = "379" RPL_VISIBLEHOST = "396" ERR_UNKNOWNERROR = "400" ERR_INVALIDCAPCMD = "410" RPL_WHOISSECURE = "671" // https://ircv3.net/specs/extensions/bot-mode RPL_WHOISBOT = "335" )
View Source
const MaxSASLLength = 400
View Source
const ServerTimeLayout = "2006-01-02T15:04:05.000Z"
The server-time layout, as defined in the IRCv3 spec.
Variables ¶
This section is empty.
Functions ¶
func FormatServerTime ¶
FormatServerTime formats a time with the server-time layout.
func GenerateIsupport ¶
func GenerateIsupport(tokens []string) []*irc.Message
func GenerateJoin ¶
func GenerateJoin(channels, keys []string) []*irc.Message
func GenerateMOTD ¶
func GenerateMOTD(motd string) []*irc.Message
func GenerateMonitor ¶
func GenerateNamesReply ¶
func GenerateNamesReply(channel string, status ChannelStatus, members []string) []*irc.Message
func GenerateSASL ¶
func GenerateSASL(resp []byte) []*irc.Message
func GenerateWHOXReply ¶
func ParseCTCPMessage ¶
ParseCTCPMessage parses a CTCP message. CTCP is defined in https://tools.ietf.org/html/draft-oakley-irc-ctcp-02
func ParseWHOXOptions ¶ added in v0.6.0
Types ¶
type CapRegistry ¶
func NewCapRegistry ¶
func NewCapRegistry() CapRegistry
func (*CapRegistry) Del ¶
func (cr *CapRegistry) Del(name string)
func (*CapRegistry) IsAvailable ¶
func (cr *CapRegistry) IsAvailable(name string) bool
func (*CapRegistry) IsEnabled ¶
func (cr *CapRegistry) IsEnabled(name string) bool
func (*CapRegistry) SetEnabled ¶
func (cr *CapRegistry) SetEnabled(name string, enabled bool)
type CaseMapping ¶ added in v0.6.0
CaseMapping returns the canonical representation of a name according to an IRC case-mapping.
var ( CaseMappingASCII CaseMapping = casemapASCII CaseMappingRFC1459 CaseMapping = casemapRFC1459 CaseMappingRFC1459Strict CaseMapping = casemapRFC1459Strict )
func ParseCaseMapping ¶ added in v0.6.0
func ParseCaseMapping(s string) CaseMapping
type CaseMappingMap ¶ added in v0.6.0
type CaseMappingMap[V interface{}] struct {
// contains filtered or unexported fields
}
func NewCaseMappingMap ¶ added in v0.6.0
func NewCaseMappingMap[V interface{}](cm CaseMapping) CaseMappingMap[V]
func (*CaseMappingMap[V]) Del ¶ added in v0.6.0
func (cmm *CaseMappingMap[V]) Del(name string)
func (*CaseMappingMap[V]) ForEach ¶ added in v0.6.0
func (cmm *CaseMappingMap[V]) ForEach(f func(string, V))
func (*CaseMappingMap[V]) Get ¶ added in v0.6.0
func (cmm *CaseMappingMap[V]) Get(name string) V
func (*CaseMappingMap[V]) Has ¶ added in v0.6.0
func (cmm *CaseMappingMap[V]) Has(name string) bool
func (*CaseMappingMap[V]) Len ¶ added in v0.6.0
func (cmm *CaseMappingMap[V]) Len() int
func (*CaseMappingMap[V]) Set ¶ added in v0.6.0
func (cmm *CaseMappingMap[V]) Set(name string, value V)
func (*CaseMappingMap[V]) SetCaseMapping ¶ added in v0.6.0
func (cmm *CaseMappingMap[V]) SetCaseMapping(newCasemap CaseMapping)
type ChannelStatus ¶
type ChannelStatus byte
const ( ChannelPublic ChannelStatus = '=' ChannelSecret ChannelStatus = '@' ChannelPrivate ChannelStatus = '*' )
func ParseChannelStatus ¶
func ParseChannelStatus(s string) (ChannelStatus, error)
type Membership ¶
Membership is a channel member rank.
type MembershipSet ¶
type MembershipSet []Membership
MembershipSet is a set of memberships sorted by descending rank.
func (*MembershipSet) Add ¶
func (ms *MembershipSet) Add(availableMemberships []Membership, newMembership Membership)
func (*MembershipSet) Remove ¶
func (ms *MembershipSet) Remove(membership Membership)
Click to show internal directories.
Click to hide internal directories.