isupport

package
v0.0.0-...-df918ef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2022 License: ISC Imports: 5 Imported by: 0

Documentation

Overview

Package isupport provides parsers for IRC ISUPPORT lines

Package isupport contains an implementation of an ISUPPORT message handler

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ISupport

type ISupport struct {
	// contains filtered or unexported fields
}

ISupport represents ISUPPORT tokens from the server

func New

func New() *ISupport

New creates a new instance of ISupport ready for use

func (*ISupport) CaseMapping

func (i *ISupport) CaseMapping() string

CaseMapping returns the casemapping of the server, or "" if unset

func (*ISupport) ChanLimit

func (i *ISupport) ChanLimit() map[string]int

ChanLimit returns the maximum number of channels a client may be in, per channel type https://modern.ircdocs.horse/#chanlimit-parameter

func (*ISupport) ChanModes

func (i *ISupport) ChanModes() string

ChanModes Returns the raw CHANMODES isupport param. You likely want Modes https://modern.ircdocs.horse/#chanmodes-parameter

func (*ISupport) ChanTypes

func (i *ISupport) ChanTypes() []string

ChanTypes returns the list of channel types supported by the network https://modern.ircdocs.horse/#chantypes-parameter

func (*ISupport) EList

func (i *ISupport) EList() []string

EList returns the supported extensions to the LIST command https://modern.ircdocs.horse/#elist-parameter

func (*ISupport) Excepts

func (i *ISupport) Excepts() string

Excepts returns the mode to set ban exemptions, assuming the server supports it.

func (*ISupport) Extban

func (i *ISupport) Extban() (prefix string, types []string)

Extban returns the prefix and available extban characters https://modern.ircdocs.horse/#rplisupport-parameters

func (*ISupport) GetToken

func (i *ISupport) GetToken(name string) (value string, exists bool)

GetToken gets a token by name if it exists. You will likely want to use named methods for the token you want instead, assuming they exist.

func (*ISupport) GetTokenDefault

func (i *ISupport) GetTokenDefault(name, dflt string) string

GetTokenDefault gets the given token, and returns a default if the *content* of the token is "". You should verify that the token at least existed before using this.

func (*ISupport) HasToken

func (i *ISupport) HasToken(name string) bool

HasToken returns whether or not the token exists

func (*ISupport) InviteExemption

func (i *ISupport) InviteExemption() string

InviteExemption returns the invite exemption mode, if supported https://modern.ircdocs.horse/#invex-parameter

func (*ISupport) MaxAwayLen

func (i *ISupport) MaxAwayLen() int

MaxAwayLen returns the maximum size of an away message, or -1 if unlimited or unset

func (*ISupport) MaxChanLen

func (i *ISupport) MaxChanLen() int

MaxChanLen returns the maximum length of a channel the client may join https://modern.ircdocs.horse/#channellen-parameter

func (*ISupport) MaxCommandTargets

func (i *ISupport) MaxCommandTargets() map[string]int

MaxCommandTargets returns a map of commandname (ToLower()'d) to int, where the int is the maximum number of targets allowed, -1 meaning no limit https://modern.ircdocs.horse/#targmax-parameter

func (*ISupport) MaxHostLen

func (i *ISupport) MaxHostLen() int

MaxHostLen returns the maximum hostname length the server SHOULD use Its possible this will be outright ignored https://modern.ircdocs.horse/#hostlen-parameter

func (*ISupport) MaxKickLen

func (i *ISupport) MaxKickLen() int

MaxKickLen returns the maximum length a kick message should have when sent by the client https://modern.ircdocs.horse/#kicklen-parameter

func (*ISupport) MaxListModes

func (i *ISupport) MaxListModes() map[rune]int

MaxListModes returns an array of mode char -> int, mapping the maximum https://modern.ircdocs.horse/#maxlist-parameter

func (*ISupport) MaxModes

func (i *ISupport) MaxModes() int

MaxModes returns the maximum number of type A, B, and C modes that should be sent in a single MODE command. -1 is returned when either the token wasn't present, or the number is unlimited https://modern.ircdocs.horse/#modes-parameter

func (*ISupport) MaxNickLen

func (i *ISupport) MaxNickLen() int

MaxNickLen returns the maximum nick length the client should send to the server https://modern.ircdocs.horse/#nicklen-parameter

func (*ISupport) MaxTargets

func (i *ISupport) MaxTargets() int

MaxTargets returns the maximum targets for all commands. i.MaxCommandTargets should be preferred to this if available https://modern.ircdocs.horse/#maxtargets-parameter

func (*ISupport) MaxTopicLen

func (i *ISupport) MaxTopicLen() int

MaxTopicLen returns the maximum topic size the client should send to the server https://modern.ircdocs.horse/#topiclen-parameter

func (*ISupport) Modes

func (i *ISupport) Modes() mode.Set

Modes returns the channel modes available on this ISupport struct. the returned data is a copy

func (*ISupport) Network

func (i *ISupport) Network() string

Network returns the content of the NETWORK token, if it exists https://modern.ircdocs.horse/#network-parameter

func (*ISupport) NumericToken

func (i *ISupport) NumericToken(name string) int

NumericToken returns the value of a token as a number, or -1 if it either doesn't exist, or fails to be parsed as a base 10 number

func (*ISupport) Parse

func (i *ISupport) Parse(msg *ircmsg.Message)

Parse parses an RPL_ISUPPORT line into its constituent tokens, and adds them to the ISupport struct

func (*ISupport) Prefix

func (i *ISupport) Prefix() map[rune]rune

Prefix returns a map of modeChar -> prefix https://modern.ircdocs.horse/#prefix-parameter

func (*ISupport) SafeList

func (i *ISupport) SafeList() bool

SafeList returns whether or not LIST usage promises to not RECVQ (disconnect due to large buffer of sent data server side) https://modern.ircdocs.horse/#safelist-parameter

func (*ISupport) SilenceMax

func (i *ISupport) SilenceMax() int

SilenceMax returns the maximum number of entries on the SILENCE list. a return of -1 indicates silence is *NOT* supported https://modern.ircdocs.horse/#silence-parameter

func (*ISupport) StatusMsg

func (i *ISupport) StatusMsg() []string

StatusMsg returns the different prefixes for status messages, or nil https://modern.ircdocs.horse/#statusmsg-parameter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL