Documentation ¶
Index ¶
- Variables
- type Ban
- type ModeChange
- type ModeChangeAction
- type ModeChangeEvent
- type ModeChangeHandler
- type ModeChangeHandlerFunc
- type Plugin
- func (p *Plugin) Bans(target string) (banlist []Ban, err error)
- func (plugin *Plugin) Handle(name string, h ModeChangeHandler) client.Remover
- func (plugin *Plugin) HandleBG(name string, h ModeChangeHandler) client.Remover
- func (plugin *Plugin) HandleFunc(name string, hf ModeChangeHandlerFunc) client.Remover
- type User
Constants ¶
This section is empty.
Variables ¶
var ErrNotAChannel = errors.New("Not a channel.")
Functions ¶
This section is empty.
Types ¶
type ModeChange ¶
type ModeChange struct { Action ModeChangeAction Mode rune HasArgument bool Argument string }
type ModeChangeAction ¶
type ModeChangeAction byte
const ( ModeChangeAction_Added ModeChangeAction = iota ModeChangeAction_Removed )
type ModeChangeEvent ¶
type ModeChangeEvent struct {
Host, Ident, Nick, Src string
Tags map[string]string
Target string
ModeChange
}
type ModeChangeHandler ¶
type ModeChangeHandler interface {
Handle(*ModeChangeEvent)
}
Handlers are triggered on incoming mode changes from the server. The handler name corresponds to the mode change that has been done, with the first character being either "+" (add) or "-" (remove) and the second being the mode character. The handler name can also be "*" to handle all mode changes.
Foreground handlers have a guarantee of protocol consistency: all the handlers for one event will have finished before the handlers for the next start processing. They are run in parallel but block the event loop, so care should be taken to ensure these handlers are quick :-)
Background handlers are run in parallel and do not block the event loop. This is useful for things that may need to do significant work.
type ModeChangeHandlerFunc ¶
type ModeChangeHandlerFunc func(*ModeChangeEvent)
HandlerFunc allows a bare function with this signature to implement the Handler interface. It is used by Plugin.HandleFunc.
func (ModeChangeHandlerFunc) Handle ¶
func (hf ModeChangeHandlerFunc) Handle(e *ModeChangeEvent)
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func (*Plugin) Handle ¶
func (plugin *Plugin) Handle(name string, h ModeChangeHandler) client.Remover
Handle adds the provided handler to the foreground set for the named event. It will return a Remover that allows that handler to be removed again.
func (*Plugin) HandleBG ¶
func (plugin *Plugin) HandleBG(name string, h ModeChangeHandler) client.Remover
HandleBG adds the provided handler to the background set for the named event. It may go away in the future. It will return a Remover that allows that handler to be removed again.
func (*Plugin) HandleFunc ¶
func (plugin *Plugin) HandleFunc(name string, hf ModeChangeHandlerFunc) client.Remover
HandleFunc adds the provided function as a handler in the foreground set for the named event. It will return a Remover that allows that handler to be removed again.