Documentation ¶
Index ¶
- Constants
- Variables
- type Clients
- func (c *Clients) Add(nickname string)
- func (c *Clients) Clear()
- func (c *Clients) Contains(nickname string) (ok bool)
- func (c *Clients) Get(nickname string) (mode Mode, ok bool)
- func (c *Clients) Remove(nickname string)
- func (c *Clients) Sanitize(nickname string) (string, Mode)
- func (c *Clients) Set(nickname string, mode Mode)
- type Config
- type Dialer
- type Error
- type ExprError
- type IRC
- func (r *IRC) Close()
- func (r *IRC) Connect() (err error)
- func (r *IRC) Connected() bool
- func (r *IRC) Context() context.Context
- func (r *IRC) Join()
- func (r *IRC) LastMessage() uint64
- func (r *IRC) OnConnect(fn OnConnect)
- func (r *IRC) OnDisconnect(fn OnDisconnect)
- func (r *IRC) OnError(fn OnError)
- func (r *IRC) OnReceive(fn OnReceive)
- func (r *IRC) OnReceiveExp(exp *regexp.Regexp, cb OnReceiveExp)
- func (r *IRC) OnSend(fn OnSend)
- func (r *IRC) Privmsg(to, msg string)
- func (r *IRC) Register()
- func (r *IRC) SendRaw(message string)
- func (r *IRC) SendRawf(format string, a ...any)
- type Mode
- type OnConnect
- type OnDisconnect
- type OnError
- type OnReceive
- type OnReceiveExp
- type OnSend
- type Timeout
Constants ¶
View Source
const ( ErrBannedFromChannel = Error("banned from channel") ErrInviteOnlyChannel = Error("invite only channel") ErrChannelUserLimitReached = Error("channel user limit reached") ErrUnsupportedDialer = Error("unsupported dialer") )
View Source
const ( // ErrPONGTimeout is thrown when the server doesn't receive the 'PONG' message before the // defined time-out. ErrPONGTimeout = Error("`PONG` timed out") )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Clients ¶
Clients is the stored which holds all the connected IRC clients.
func (*Clients) Add ¶
Add will add an entry to the clients store if it doesn't exist or is not empty.
func (*Clients) Clear ¶
func (c *Clients) Clear()
Clear will empty the store, everything will be reset.
func (*Clients) Contains ¶
Contains returns a bool which returns true or false if the user is stored.
type Config ¶
type Dialer ¶
type Dialer interface { // Dial takes two arguments. Network, which should be similar to "tcp", // "tdp6", "udp", etc -- as well as address, which is the hostname or ip // of the network. Note that network can be ignored if your transport // doesn't take advantage of network types. Dial(network, address string) (net.Conn, error) }
Dialer is an interface implementation of net.Dialer. Use this if you would like to implement your own dialer which the client will use when connecting.
type ExprError ¶
type IRC ¶
type IRC struct { // Clients connected to the IRC host along with their modes. Clients Clients // contains filtered or unexported fields }
IRC is our IRC connection which is being used as an XDCC client.
func NewIRCWithDialer ¶
func (*IRC) LastMessage ¶
func (*IRC) OnDisconnect ¶
func (r *IRC) OnDisconnect(fn OnDisconnect)
func (*IRC) OnReceiveExp ¶
func (r *IRC) OnReceiveExp(exp *regexp.Regexp, cb OnReceiveExp)
type Mode ¶
type Mode rune
Mode is a proxy type for rune
const ( // ModeOwner represents nicknames which start with '~'. ModeOwner Mode = '~' // ModeAdmin represents nicknames which start with '&'. ModeAdmin Mode = '&' // ModeOper represents nicknames which start with '@'. ModeOper Mode = '@' // ModeHalfOp represents nicknames which starts with '%'. ModeHalfOp Mode = '%' // ModeVoice represents nicknames which start with '+'. ModeVoice Mode = '+' // ModeMember represents nicknames which don't start with anything. ModeMember )
type OnDisconnect ¶
type OnDisconnect func()
Click to show internal directories.
Click to hide internal directories.