Documentation
¶
Overview ¶
Package ircsupport parses and stores the negotiated IRC 005 RPL_ISUPPORT tokens and exposes server-dependent helpers derived from them.
Index ¶
- type ChanModeKind
- type ISupport
- func (i *ISupport) Apply(token string)
- func (i *ISupport) CaseMap() casemap.Mapper
- func (i *ISupport) ChanModeKind(m rune) ChanModeKind
- func (i *ISupport) Fold(s string) string
- func (i *ISupport) Get(key string) (string, bool)
- func (i *ISupport) IsChannel(target string) bool
- func (i *ISupport) ModeFromSigil(sigil rune) (rune, bool)
- func (i *ISupport) Network() string
- func (i *ISupport) ParseModeString(modes string, params []string) []ModeChange
- func (i *ISupport) ParseUserModeString(modes string) []ModeChange
- func (i *ISupport) PrefixModes() []rune
- func (i *ISupport) PrefixSigil(mode rune) (rune, bool)
- type ISupportView
- type ModeChange
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChanModeKind ¶
type ChanModeKind int
ChanModeKind classifies a channel mode by its CHANMODES letter group.
const ( // ChanModeUnknown indicates a mode not listed in CHANMODES. ChanModeUnknown ChanModeKind = iota // ChanModeListMask is a group A mode that always takes a parameter. ChanModeListMask // ChanModeParamSet is a group B mode that takes a parameter on add and remove. ChanModeParamSet // ChanModeParamAdd is a group C mode that takes a parameter only on add. ChanModeParamAdd // ChanModePlain is a group D mode that takes no parameter. ChanModePlain )
type ISupport ¶
type ISupport struct {
// contains filtered or unexported fields
}
ISupport holds the negotiated 005 RPL_ISUPPORT tokens and is goroutine-safe.
func (*ISupport) Apply ¶
Apply ingests a single ISUPPORT token of the form "KEY=VAL", bare "KEY", or "-KEY".
func (*ISupport) ChanModeKind ¶
func (i *ISupport) ChanModeKind(m rune) ChanModeKind
ChanModeKind returns the CHANMODES classification of channel mode m.
func (*ISupport) Get ¶
Get returns the value stored for key and reports whether the token is present.
func (*ISupport) IsChannel ¶
IsChannel reports whether target names a channel under the negotiated CHANTYPES.
func (*ISupport) ModeFromSigil ¶
ModeFromSigil returns the membership mode for a sigil and reports whether it is known.
func (*ISupport) Network ¶
Network returns the negotiated network name, or the empty string if unset.
func (*ISupport) ParseModeString ¶
func (i *ISupport) ParseModeString(modes string, params []string) []ModeChange
ParseModeString turns a channel MODE string and its params into ordered changes.
func (*ISupport) ParseUserModeString ¶
func (i *ISupport) ParseUserModeString(modes string) []ModeChange
ParseUserModeString parses a user MODE string into ordered changes without parameters.
func (*ISupport) PrefixModes ¶
PrefixModes returns the membership mode letters in PREFIX order, highest privilege first.
type ISupportView ¶
type ISupportView interface {
Get(key string) (string, bool)
Network() string
CaseMap() casemap.Mapper
Fold(s string) string
IsChannel(target string) bool
PrefixModes() []rune
PrefixSigil(mode rune) (rune, bool)
ModeFromSigil(sigil rune) (rune, bool)
ParseModeString(modes string, params []string) []ModeChange
ParseUserModeString(modes string) []ModeChange
ChanModeKind(m rune) ChanModeKind
}
ISupportView is the read-only surface of ISupport handed to consumers.
type ModeChange ¶
ModeChange represents a single add or remove of one mode with its parameter.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package casemap folds nicks and channel names to a canonical form per the negotiated CASEMAPPING token so that case-insensitive comparison works.
|
Package casemap folds nicks and channel names to a canonical form per the negotiated CASEMAPPING token so that case-insensitive comparison works. |