parser

package
v0.0.0-...-1edf84f Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConnTimeout    = 30 * time.Second
	DefaultReadTimeout    = 300 * time.Second // 5 minutes
	DefaultWriteTimeout   = 30 * time.Second
	DefaultPingTimeout    = 60 * time.Second
	DefaultReconnectDelay = 5 * time.Second
	WriteFlushInterval    = 100 * time.Millisecond
	ConnectionWorkerCount = 2
)
View Source
const (
	DefaultEventChannelBuffer = 100
	PanicStackBufferSize      = 1024

	CTCPDelimiter = '\x01'
	MinCTCPLength = 2

	ServerTimeFormat = "2006-01-02T15:04:05.000Z"
	ServerTimeTag    = "time"
)
View Source
const (
	NumericWelcome       = "001"
	NumericISupport      = "005"
	NumericSASLSuccess1  = "900"
	NumericSASLSuccess2  = "903"
	NumericSASLFail1     = "901"
	NumericSASLFail2     = "902"
	NumericSASLFail3     = "904"
	NumericSASLFail4     = "905"
	NumericSASLFail5     = "906"
	NumericSASLFail6     = "907"
	NumericSASLFail7     = "908"
	NumericWhoisUser     = "311"
	NumericWhoisServer   = "312"
	NumericWhoisOperator = "313"
	NumericWhoisIdle     = "317"
	NumericWhoisEnd      = "318"
	NumericWhoisChannels = "319"
	NumericWhoReply      = "352"
	NumericWhoEnd        = "315"
	NumericListStart     = "321"
	NumericList          = "322"
	NumericListEnd       = "323"
	NumericNamesReply    = "353"
	NumericNamesEnd      = "366"
	NumericTopic         = "332"
	NumericTopicInfo     = "333"
	NumericNickInUse     = "433"
)
View Source
const (
	MaxMessageLength = 512
	MaxTagLength     = 8192
)

Message parsing constants

View Source
const (
	DefaultRegistrationTimeout = 60 * time.Second
	UserModeVisible            = "0"
	UserServerWildcard         = "*"
)

Registration constants

View Source
const (
	DefaultSASLTimeout   = 30 * time.Second
	DefaultSASLChunkSize = 400
)

SASL constants

View Source
const (
	DefaultCapabilityProtocolVersion = "302"
)
View Source
const (
	LogTrace = -8
)

Variables

This section is empty.

Functions

func SetupDefaultHandlers

func SetupDefaultHandlers(ctx context.Context, connection *Connection, eventBus *EventBus, config *ConnectionConfig, capabilities map[string]string)

SetupDefaultHandlers sets up the default IRC handlers for a parser

Types

type ActionData

type ActionData struct {
	Target  string
	Nick    string
	Message string
}

type CapAddedData

type CapAddedData struct {
	Capability string
}

type CapData

type CapData struct {
	Subcommand string
	Caps       []string
}

type CapPreEndData

type CapPreEndData struct {
	ActiveCaps []string
	CapValues  map[string]string
}

type CapRemovedData

type CapRemovedData struct {
	Capability string
}

type CapabilitiesHandler

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

func NewCapabilitiesHandler

func NewCapabilitiesHandler(
	ctx context.Context,
	send func(command string, params ...string) error,
	subscribe func(EventType, EventHandler) int,
	emit func(event *Event),
	countListeners func(EventType) int,
	capabilities map[string]string, caps ...string,
) *CapabilitiesHandler

func (*CapabilitiesHandler) EndCapabilityNegotiation

func (ch *CapabilitiesHandler) EndCapabilityNegotiation() error

func (*CapabilitiesHandler) GetActiveCaps

func (ch *CapabilitiesHandler) GetActiveCaps() []string

func (*CapabilitiesHandler) HandleCapACK

func (ch *CapabilitiesHandler) HandleCapACK(event *Event)

func (*CapabilitiesHandler) HandleCapDEL

func (ch *CapabilitiesHandler) HandleCapDEL(event *Event)

func (*CapabilitiesHandler) HandleCapEnd

func (ch *CapabilitiesHandler) HandleCapEnd(*Event)

func (*CapabilitiesHandler) HandleCapEndReady

func (ch *CapabilitiesHandler) HandleCapEndReady(*Event)

func (*CapabilitiesHandler) HandleCapLS

func (ch *CapabilitiesHandler) HandleCapLS(event *Event)

func (*CapabilitiesHandler) HandleCapNAK

func (ch *CapabilitiesHandler) HandleCapNAK(event *Event)

func (*CapabilitiesHandler) HandleCapNEW

func (ch *CapabilitiesHandler) HandleCapNEW(event *Event)

func (*CapabilitiesHandler) HandleConnected

func (ch *CapabilitiesHandler) HandleConnected(*Event)

func (*CapabilitiesHandler) IsCapabilityActive

func (ch *CapabilitiesHandler) IsCapabilityActive(capability string) bool

func (*CapabilitiesHandler) RequestCapabilities

func (ch *CapabilitiesHandler) RequestCapabilities(capabilities []string) error

func (*CapabilitiesHandler) Reset

func (ch *CapabilitiesHandler) Reset()

type Channel

type Channel struct {
	Name    string
	Topic   string
	TopicBy string
	TopicAt time.Time
	Users   map[string]*User
	Modes   []ChannelMode
	// contains filtered or unexported fields
}

Channel represents an IRC channel

func NewChannel

func NewChannel(name string) *Channel

func (*Channel) AddMode

func (c *Channel) AddMode(mode rune, parameter string)

func (*Channel) AddUser

func (c *Channel) AddUser(user *User)

func (*Channel) GetModes

func (c *Channel) GetModes() []ChannelMode

func (*Channel) GetUser

func (c *Channel) GetUser(nick string) *User

func (*Channel) GetUserCount

func (c *Channel) GetUserCount() int

func (*Channel) GetUsers

func (c *Channel) GetUsers() map[string]*User

func (*Channel) HasMode

func (c *Channel) HasMode(mode rune) bool

func (*Channel) RemoveMode

func (c *Channel) RemoveMode(mode rune)

func (*Channel) RemoveUser

func (c *Channel) RemoveUser(nick string)

func (*Channel) RenameUser

func (c *Channel) RenameUser(oldNick, newNick string)

func (*Channel) SetTopic

func (c *Channel) SetTopic(topic, by string, at time.Time)

type ChannelMode

type ChannelMode struct {
	Mode      rune
	Parameter string
}

ChannelMode represents a channel mode with its character and parameter

type ConnectedData

type ConnectedData struct {
	ServerName string
	UserModes  string
}

type Connection

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

func NewConnection

func NewConnection(ctx context.Context, config *ConnectionConfig, eventBus *EventBus) *Connection

func (*Connection) Connect

func (c *Connection) Connect() error

func (*Connection) Disconnect

func (c *Connection) Disconnect()

func (*Connection) GetConfig

func (c *Connection) GetConfig() *ConnectionConfig

func (*Connection) GetCurrentNick

func (c *Connection) GetCurrentNick() string

func (*Connection) GetISupport

func (c *Connection) GetISupport() map[string]string

func (*Connection) GetISupportValue

func (c *Connection) GetISupportValue(key string) string

func (*Connection) GetServerName

func (c *Connection) GetServerName() string

func (*Connection) GetState

func (c *Connection) GetState() ConnectionState

func (*Connection) IsConnected

func (c *Connection) IsConnected() bool

func (*Connection) IsRegistered

func (c *Connection) IsRegistered() bool

func (*Connection) Send

func (c *Connection) Send(command string, params ...string) error

func (*Connection) SendRaw

func (c *Connection) SendRaw(line string) error

func (*Connection) Wait

func (c *Connection) Wait()

type ConnectionConfig

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

func NewConnectionConfig

func NewConnectionConfig(host string, options ...Option) *ConnectionConfig

func (*ConnectionConfig) ConnTimeout

func (c *ConnectionConfig) ConnTimeout() time.Duration

func (*ConnectionConfig) Host

func (c *ConnectionConfig) Host() string

func (*ConnectionConfig) Nick

func (c *ConnectionConfig) Nick() string

func (*ConnectionConfig) Password

func (c *ConnectionConfig) Password() string

func (*ConnectionConfig) PingTimeout

func (c *ConnectionConfig) PingTimeout() time.Duration

func (*ConnectionConfig) Port

func (c *ConnectionConfig) Port() int

func (*ConnectionConfig) ReadTimeout

func (c *ConnectionConfig) ReadTimeout() time.Duration

func (*ConnectionConfig) Realname

func (c *ConnectionConfig) Realname() string

func (*ConnectionConfig) ReconnectDelay

func (c *ConnectionConfig) ReconnectDelay() time.Duration

func (*ConnectionConfig) SASLPass

func (c *ConnectionConfig) SASLPass() string

func (*ConnectionConfig) SASLUser

func (c *ConnectionConfig) SASLUser() string

func (*ConnectionConfig) TLS

func (c *ConnectionConfig) TLS() bool

func (*ConnectionConfig) Username

func (c *ConnectionConfig) Username() string

func (*ConnectionConfig) WriteTimeout

func (c *ConnectionConfig) WriteTimeout() time.Duration

type ConnectionState

type ConnectionState int
const (
	StateDisconnected ConnectionState = iota
	StateConnecting
	StateConnected
	StateRegistering
	StateRegistered
	StateDisconnecting
)

func (ConnectionState) String

func (s ConnectionState) String() string

type DisconnectedData

type DisconnectedData struct {
	Reason string
	Error  error
}

type ErrorData

type ErrorData struct {
	Message string
}

type Event

type Event struct {
	Type    EventType
	Message *Message
	Data    interface{}
	Time    time.Time
}

func CreateEventFromMessage

func CreateEventFromMessage(msg *Message) []*Event

type EventBus

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

func NewEventBus

func NewEventBus(ctx context.Context) *EventBus

func (*EventBus) Close

func (eb *EventBus) Close()

func (*EventBus) CountListeners

func (eb *EventBus) CountListeners(eventType EventType) int

func (*EventBus) Emit

func (eb *EventBus) Emit(event *Event)

func (*EventBus) Subscribe

func (eb *EventBus) Subscribe(eventType EventType, handler EventHandler) int

func (*EventBus) UnsubscribeByID

func (eb *EventBus) UnsubscribeByID(eventType EventType, id int)

func (*EventBus) Wait

func (eb *EventBus) Wait()

type EventHandler

type EventHandler func(event *Event)

type EventType

type EventType string
const (
	EventConnected     EventType = "connected"
	EventDisconnected  EventType = "disconnected"
	EventMessage       EventType = "message"
	EventPing          EventType = "ping"
	EventPong          EventType = "pong"
	EventError         EventType = "error"
	EventCapLS         EventType = "cap_ls"
	EventCapACK        EventType = "cap_ack"
	EventCapNAK        EventType = "cap_nak"
	EventCapDEL        EventType = "cap_del"
	EventCapNEW        EventType = "cap_new"
	EventCapAdded      EventType = "cap_added"
	EventCapRemoved    EventType = "cap_removed"
	EventCapPreEnd     EventType = "cap_pre_end"
	EventCapEndReady   EventType = "cap_end_ready"
	EventCapEnd        EventType = "cap_end"
	EventSASLAuth      EventType = "sasl_auth"
	EventSASLSuccess   EventType = "sasl_success"
	EventSASLFail      EventType = "sasl_fail"
	EventRegistered    EventType = "registered"
	EventNick          EventType = "nick"
	EventJoin          EventType = "join"
	EventPart          EventType = "part"
	EventQuit          EventType = "quit"
	EventKick          EventType = "kick"
	EventMode          EventType = "mode"
	EventTopic         EventType = "topic"
	EventPrivmsg       EventType = "privmsg"
	EventNotice        EventType = "notice"
	EventInvite        EventType = "invite"
	EventWhois         EventType = "whois"
	EventWho           EventType = "who"
	EventList          EventType = "list"
	EventNames         EventType = "names"
	EventNamesComplete EventType = "names_complete"
	EventCTCP          EventType = "ctcp"
	EventCTCPReply     EventType = "ctcp_reply"
	EventAction        EventType = "action"
	EventNumeric       EventType = "numeric"
	EventRawIncoming   EventType = "raw_incoming"
	EventRawOutgoing   EventType = "raw_outgoing"
	EventUnknown       EventType = "unknown"
)

func DetermineEventType

func DetermineEventType(msg *Message) []EventType

type IRCError

type IRCError struct {
	Operation string
	Message   string
	Err       error
}

func NewConnectionError

func NewConnectionError(operation, message string, err error) *IRCError

func NewMessageError

func NewMessageError(operation, message string, err error) *IRCError

func NewRegistrationError

func NewRegistrationError(operation, message string) *IRCError

func NewSASLError

func NewSASLError(operation, message string, err error) *IRCError

func (*IRCError) Error

func (e *IRCError) Error() string

func (*IRCError) Unwrap

func (e *IRCError) Unwrap() error

type InviteData

type InviteData struct {
	Channel string
	Nick    string
	Target  string
}

type JoinData

type JoinData struct {
	Channel string
	Nick    string
}

type KickData

type KickData struct {
	Channel string
	Nick    string
	Kicked  string
	Reason  string
}

type Message

type Message struct {
	Tags    Tags
	Source  string
	Command string
	Params  []string
	Raw     string
}

func ParseMessage

func ParseMessage(raw string) (*Message, error)

func (*Message) GetParam

func (m *Message) GetParam(index int) string

func (*Message) GetTag

func (m *Message) GetTag(key string) (string, bool)

func (*Message) GetTrailing

func (m *Message) GetTrailing() string

func (*Message) HasTag

func (m *Message) HasTag(key string) bool

func (*Message) IsNumeric

func (m *Message) IsNumeric() bool

func (*Message) ParamCount

func (m *Message) ParamCount() int

func (*Message) String

func (m *Message) String() string

type ModeData

type ModeData struct {
	Target string
	Modes  string
	Args   []string
}

type NamesCompleteData

type NamesCompleteData struct {
	Channel *Channel // Channel object
}

type NickData

type NickData struct {
	OldNick string
	NewNick string
}

type NoticeData

type NoticeData struct {
	Target   string
	Nick     string
	Message  string
	IsAction bool
	IsCTCP   bool
}

type NumericData

type NumericData struct {
	Code   string
	Params []string
}

type Option

type Option func(*ConnectionConfig)

func WithConnTimeout

func WithConnTimeout(timeout time.Duration) Option

func WithNick

func WithNick(nick string) Option

func WithPassword

func WithPassword(password string) Option

func WithPingTimeout

func WithPingTimeout(timeout time.Duration) Option

func WithPort

func WithPort(port int) Option

func WithReadTimeout

func WithReadTimeout(timeout time.Duration) Option

func WithRealname

func WithRealname(realname string) Option

func WithReconnectDelay

func WithReconnectDelay(delay time.Duration) Option

func WithSASL

func WithSASL(username, password string) Option

func WithTLS

func WithTLS(tls bool) Option

func WithUsername

func WithUsername(username string) Option

func WithWriteTimeout

func WithWriteTimeout(timeout time.Duration) Option

type Parser

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

func NewParser

func NewParser(ctx context.Context, config *ConnectionConfig) *Parser

func (*Parser) EmitEvent

func (p *Parser) EmitEvent(event *Event)

func (*Parser) GetConnection

func (p *Parser) GetConnection() *Connection

func (*Parser) GetCurrentNick

func (p *Parser) GetCurrentNick() string

func (*Parser) GetEventBus

func (p *Parser) GetEventBus() *EventBus

func (*Parser) GetISupport

func (p *Parser) GetISupport() map[string]string

func (*Parser) GetISupportValue

func (p *Parser) GetISupportValue(key string) string

func (*Parser) GetServerName

func (p *Parser) GetServerName() string

func (*Parser) GetState

func (p *Parser) GetState() ConnectionState

func (*Parser) Invite

func (p *Parser) Invite(nick, channel string) error

func (*Parser) IsConnected

func (p *Parser) IsConnected() bool

func (*Parser) IsRegistered

func (p *Parser) IsRegistered() bool

func (*Parser) Join

func (p *Parser) Join(channel string) error

func (*Parser) Kick

func (p *Parser) Kick(channel, nick, reason string) error

func (*Parser) List

func (p *Parser) List(channels ...string) error

func (*Parser) Mode

func (p *Parser) Mode(target, modes string, args ...string) error

func (*Parser) Names

func (p *Parser) Names(channels ...string) error

func (*Parser) Nick

func (p *Parser) Nick(nick string) error

func (*Parser) Notice

func (p *Parser) Notice(target, message string) error

func (*Parser) Part

func (p *Parser) Part(channel string, reason string) error

func (*Parser) Privmsg

func (p *Parser) Privmsg(target, message string) error

func (*Parser) Quit

func (p *Parser) Quit(reason string) error

func (*Parser) Send

func (p *Parser) Send(command string, params ...string) error

func (*Parser) SendRaw

func (p *Parser) SendRaw(line string) error

func (*Parser) Start

func (p *Parser) Start() error

func (*Parser) Stop

func (p *Parser) Stop()

func (*Parser) Subscribe

func (p *Parser) Subscribe(eventType EventType, handler EventHandler) int

func (*Parser) Topic

func (p *Parser) Topic(channel, topic string) error

func (*Parser) UnsubscribeByID

func (p *Parser) UnsubscribeByID(eventType EventType, id int)

func (*Parser) Wait

func (p *Parser) Wait()

func (*Parser) Who

func (p *Parser) Who(target string) error

func (*Parser) Whois

func (p *Parser) Whois(nick string) error

type PartData

type PartData struct {
	Channel string
	Nick    string
	Reason  string
}

type PingData

type PingData struct {
	Server string
}

type PingHandler

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

func NewPingHandler

func NewPingHandler(ctx context.Context, send func(command string, params ...string) error, subscribe func(EventType, EventHandler) int, emit func(event *Event)) *PingHandler

func (*PingHandler) HandlePing

func (h *PingHandler) HandlePing(event *Event)

func (*PingHandler) HandleRaw

func (h *PingHandler) HandleRaw(*Event)

func (*PingHandler) HandleWelcome

func (h *PingHandler) HandleWelcome(*Event)

func (*PingHandler) SendPing

func (h *PingHandler) SendPing()

type PlainMechanism

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

func NewPlainMechanism

func NewPlainMechanism(username, password string) *PlainMechanism

func (*PlainMechanism) IsComplete

func (pm *PlainMechanism) IsComplete() bool

func (*PlainMechanism) Name

func (pm *PlainMechanism) Name() string

func (*PlainMechanism) Next

func (pm *PlainMechanism) Next(string) (string, error)

func (*PlainMechanism) Reset

func (pm *PlainMechanism) Reset()

func (*PlainMechanism) Start

func (pm *PlainMechanism) Start() (string, error)

type PongData

type PongData struct {
	Server string
}

type PrivmsgData

type PrivmsgData struct {
	Target   string
	Nick     string
	Message  string
	IsAction bool
	IsCTCP   bool
}

type QuitData

type QuitData struct {
	Nick   string
	Reason string
}

type RawIncomingData

type RawIncomingData struct {
	Line      string
	Message   *Message
	Timestamp time.Time
}

type RawOutgoingData

type RawOutgoingData struct {
	Line      string
	Timestamp time.Time
}

type RegistrationHandler

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

func NewRegistrationHandler

func NewRegistrationHandler(ctx context.Context, config *ConnectionConfig, send func(command string, params ...string) error, subscribe func(EventType, EventHandler) int, unsubscribe func(EventType, int), emit func(event *Event)) *RegistrationHandler

func (*RegistrationHandler) GetState

func (rh *RegistrationHandler) GetState() RegistrationState

func (*RegistrationHandler) GetTimeout

func (rh *RegistrationHandler) GetTimeout() time.Duration

func (*RegistrationHandler) HandleConnected

func (rh *RegistrationHandler) HandleConnected(*Event)

func (*RegistrationHandler) HandleNumeric

func (rh *RegistrationHandler) HandleNumeric(event *Event)

func (*RegistrationHandler) HandleWelcome

func (rh *RegistrationHandler) HandleWelcome(event *Event)

func (*RegistrationHandler) IsActive

func (rh *RegistrationHandler) IsActive() bool

func (*RegistrationHandler) IsComplete

func (rh *RegistrationHandler) IsComplete() bool

func (*RegistrationHandler) IsFailed

func (rh *RegistrationHandler) IsFailed() bool

func (*RegistrationHandler) SetTimeout

func (rh *RegistrationHandler) SetTimeout(timeout time.Duration)

func (*RegistrationHandler) Start

func (rh *RegistrationHandler) Start() error

type RegistrationState

type RegistrationState int
const (
	RegStateInactive RegistrationState = iota
	RegStateStarted
	RegStateComplete
	RegStateFailed
)

func (RegistrationState) String

func (rs RegistrationState) String() string

type SASLData

type SASLData struct {
	Mechanism string
	Data      string
}

type SASLHandler

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

func NewSASLHandler

func NewSASLHandler(ctx context.Context,
	send func(command string, params ...string) error,
	subscribe func(EventType, EventHandler) int,
	emit func(event *Event),
	username,
	password string,
) *SASLHandler

func (*SASLHandler) Abort

func (sh *SASLHandler) Abort() error

func (*SASLHandler) GetAvailableMechanisms

func (sh *SASLHandler) GetAvailableMechanisms() []string

func (*SASLHandler) GetMaxChunkSize

func (sh *SASLHandler) GetMaxChunkSize() int

func (*SASLHandler) GetMechanism

func (sh *SASLHandler) GetMechanism() SASLMechanism

func (*SASLHandler) GetState

func (sh *SASLHandler) GetState() SASLState

func (*SASLHandler) GetTimeout

func (sh *SASLHandler) GetTimeout() time.Duration

func (*SASLHandler) HandleAuthenticate

func (sh *SASLHandler) HandleAuthenticate(event *Event)

func (*SASLHandler) HandleSASLFail

func (sh *SASLHandler) HandleSASLFail(event *Event)

func (*SASLHandler) HandleSASLSuccess

func (sh *SASLHandler) HandleSASLSuccess(*Event)

func (*SASLHandler) IsActive

func (sh *SASLHandler) IsActive() bool

func (*SASLHandler) IsAvailable

func (sh *SASLHandler) IsAvailable() bool

func (*SASLHandler) IsComplete

func (sh *SASLHandler) IsComplete() bool

func (*SASLHandler) Reset

func (sh *SASLHandler) Reset()

func (*SASLHandler) SetMaxChunkSize

func (sh *SASLHandler) SetMaxChunkSize(size int)

func (*SASLHandler) SetMechanism

func (sh *SASLHandler) SetMechanism(mechanism SASLMechanism)

func (*SASLHandler) SetTimeout

func (sh *SASLHandler) SetTimeout(timeout time.Duration)

func (*SASLHandler) StartAuthentication

func (sh *SASLHandler) StartAuthentication() error

func (*SASLHandler) SupportsPlain

func (sh *SASLHandler) SupportsPlain() bool

type SASLMechanism

type SASLMechanism interface {
	Name() string
	Start() (string, error)
	Next(challenge string) (string, error)
	IsComplete() bool
	Reset()
}

type SASLState

type SASLState int
const (
	SASLStateInactive SASLState = iota
	SASLStateRequesting
	SASLStateAuthenticating
	SASLStateSuccess
	SASLStateFailed
)

func (SASLState) String

func (s SASLState) String() string

type Tags

type Tags map[string]string

type TopicData

type TopicData struct {
	Channel string
	Topic   string
	Nick    string
}

type User

type User struct {
	Nick     string
	Username string
	Host     string
	Modes    []UserMode
	// contains filtered or unexported fields
}

User represents a user in an IRC channel

func NewUser

func NewUser(nick, username, host string) *User

func (*User) AddMode

func (u *User) AddMode(mode rune, parameter string)

func (*User) GetModes

func (u *User) GetModes() []UserMode

func (*User) GetPrefixString

func (u *User) GetPrefixString(prefixToModeMap map[rune]rune) string

GetPrefixString converts the user's modes to prefix characters using the provided channel prefix mapping prefixToModeMap should map prefix characters to their mode symbols (e.g., '@' -> 'o', '+' -> 'v') This function reverses the mapping internally to convert modes back to prefixes

func (*User) HasMode

func (u *User) HasMode(mode rune) bool

func (*User) RemoveMode

func (u *User) RemoveMode(mode rune)

type UserMode

type UserMode struct {
	Mode      rune
	Parameter string
}

UserMode represents a user mode with its character and parameter

Jump to

Keyboard shortcuts

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