package ircparse
import "github.com/hlandau/ircproto/ircparse"
Package ircparse provides an IRC message parser and serializer supporting RFC1459 and IRCv3 message tags.
Index ¶
- func IsValidChannelName(chanName string) bool
- func NickMatch(x, y string) bool
- func NormalizeChannelName(chanName string) string
- func NormalizeNickName(nickName string) string
- type Msg
Functions ¶
func IsValidChannelName ¶
Returns true iff the given string is a valid channel name.
func NickMatch ¶
Returns true iff nicknames x and y are the same.
func NormalizeChannelName ¶
Normalizes a channel name by converting it to lowercase.
func NormalizeNickName ¶
Normalizes a nickname by converting it to lowercase.
Types ¶
type Msg ¶
type Msg struct { // Where :server.name is present, this is "server.name". ServerName string // Where :nick!user@host is present, this is nick, user and host. NickName, UserName, HostName string // Command name (uppercase) or three-digit numeric. Command string // All arguments including trailing argument. Note that the trailing argument // is not in any way semantically distinct from the other arguments, but it // may contain spaces. Args []string // IRCv3 tags. nil if no tags were specified. Tags without values have empty string values. // @tag1=tagvalue;tag2=tagvalue Tags map[string]string // The raw message which was parsed. Raw string }
An RFC1459 IRC protocol message. Supports IRCv3 tags.
func Parse ¶
Parse an IRC protocol line. This should end with "\n".
func (*Msg) String ¶
Marshal a message as an RFC1459 protocol line, including any IRCv3 message tags if specified.
Source Files ¶
- Version
- v0.0.0-20240529044229-f1af42e426cd (latest)
- Published
- May 29, 2024
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 1 month ago –
Tools for package owners.