Documentation ¶
Index ¶
- Constants
- Variables
- func CasemapASCII(name string) string
- func CasemapRFC1459(name string) string
- func ChanInOut(conn net.Conn) (in <-chan Message, out chan<- Message)
- type BouncerNetworkEvent
- type Cap
- type Channel
- type ErrorEvent
- type Event
- type HistoryEvent
- type HistoryRequest
- type HistoryTargetsEvent
- type InfoEvent
- type InviteEvent
- type Member
- type Message
- type MessageEvent
- type ModeChange
- type ModeChangeEvent
- type Prefix
- type ReadEvent
- type RegisteredEvent
- type SASLClient
- type SASLPlain
- type SearchEvent
- type SelfJoinEvent
- type SelfNickEvent
- type SelfPartEvent
- type Session
- func (s *Session) Away(message string)
- func (s *Session) Casemap(name string) string
- func (s *Session) ChangeMode(channel, flags string, args []string)
- func (s *Session) ChangeNick(nick string)
- func (s *Session) ChangeTopic(channel, topic string)
- func (s *Session) ChannelsSharedWith(name string) []string
- func (s *Session) Close()
- func (s *Session) HandleMessage(msg Message) (Event, error)
- func (s *Session) HasCapability(capability string) bool
- func (s *Session) Invite(nick, channel string)
- func (s *Session) IsChannel(name string) bool
- func (s *Session) IsMe(nick string) bool
- func (s *Session) Join(channel, key string)
- func (s *Session) Kick(nick, channel, comment string)
- func (s *Session) List(pattern string)
- func (s *Session) MonitorAdd(target string)
- func (s *Session) MonitorRemove(target string)
- func (s *Session) Names(target string) []Member
- func (s *Session) NetID() string
- func (s *Session) NewHistoryRequest(target string) *HistoryRequest
- func (s *Session) Nick() string
- func (s *Session) NickCf() string
- func (s *Session) Part(channel, reason string)
- func (s *Session) PrivMsg(target, content string)
- func (s *Session) Quit(reason string)
- func (s *Session) ReadGet(target string)
- func (s *Session) ReadSet(target string, timestamp time.Time)
- func (s *Session) Search(target, text string)
- func (s *Session) Send(command string, params ...string)
- func (s *Session) SendRaw(raw string)
- func (s *Session) Topic(channel string) (topic string, who *Prefix, at time.Time)
- func (s *Session) Typing(target string)
- func (s *Session) TypingStop(target string)
- func (s *Session) TypingStops() <-chan Typing
- func (s *Session) Typings(target string) []string
- func (s *Session) Users() []string
- func (s *Session) Who(target string)
- func (s *Session) Whois(nick string)
- func (s *Session) Whowas(nick string)
- type SessionParams
- type Severity
- type TopicChangeEvent
- type Typing
- type Typings
- type User
- type UserJoinEvent
- type UserNickEvent
- type UserOfflineEvent
- type UserOnlineEvent
- type UserPartEvent
- type UserQuitEvent
Constants ¶
const ( TypingUnspec = iota TypingActive TypingPaused TypingDone )
Values taken by the "@+typing=" client tag. TypingUnspec means the value or tag is absent.
const ( ModeTypeA int = iota ModeTypeB ModeTypeC ModeTypeD )
Mode types available in the CHANMODES 005 token.
Variables ¶
var SupportedCapabilities = map[string]struct{}{
"away-notify": {},
"batch": {},
"cap-notify": {},
"echo-message": {},
"extended-monitor": {},
"invite-notify": {},
"message-tags": {},
"multi-prefix": {},
"server-time": {},
"sasl": {},
"setname": {},
"standard-replies": {},
"draft/chathistory": {},
"draft/event-playback": {},
"draft/read-marker": {},
"soju.im/bouncer-networks-notify": {},
"soju.im/bouncer-networks": {},
"soju.im/search": {},
}
SupportedCapabilities is the set of capabilities supported by this library.
Functions ¶
func CasemapASCII ¶
CasemapASCII of name is the canonical representation of name according to the ascii casemapping.
func CasemapRFC1459 ¶
CasemapRFC1459 of name is the canonical representation of name according to the rfc-1459 casemapping.
Types ¶
type BouncerNetworkEvent ¶
type Channel ¶
type Channel struct { Name string // the name of the channel. Members map[*User]string // the set of members associated with their membership. Topic string // the topic of the channel, or "" if absent. TopicWho *Prefix // the name of the last user who set the topic. TopicTime time.Time // the last time the topic has been changed. Read time.Time // the time until which messages were read. // contains filtered or unexported fields }
Channel is a joined channel.
type ErrorEvent ¶
type HistoryEvent ¶
type HistoryRequest ¶
type HistoryRequest struct {
// contains filtered or unexported fields
}
func (*HistoryRequest) After ¶
func (r *HistoryRequest) After(t time.Time)
func (*HistoryRequest) Before ¶
func (r *HistoryRequest) Before(t time.Time)
func (*HistoryRequest) Latest ¶ added in v0.3.0
func (r *HistoryRequest) Latest()
func (*HistoryRequest) WithLimit ¶
func (r *HistoryRequest) WithLimit(limit int) *HistoryRequest
type HistoryTargetsEvent ¶
type InviteEvent ¶
type Member ¶
type Member struct { PowerLevel string Name *Prefix Away bool Disconnected bool Self bool // Added by senpai }
Member is a token in RPL_NAMREPLY's last parameter.
func ParseNameReply ¶
ParseNameReply parses the last parameter of RPL_NAMREPLY, according to the membership prefixes of the server.
type Message ¶
Message is the representation of an IRC message.
func NewMessage ¶
func ParseMessage ¶
ParseMessage parses the message from the given string, which must be trimmed of "\r\n" beforehand.
func (*Message) ParseParams ¶
func (*Message) String ¶
String returns the protocol representation of the message, without an ending "\r\n".
type MessageEvent ¶
type ModeChange ¶
func ParseChannelMode ¶
func ParseChannelMode(mode string, params []string, chanmodes [4]string, membershipModes string) ([]ModeChange, error)
ParseChannelMode parses a MODE message for a channel, according to the CHANMODES of the server.
type Prefix ¶
func ParsePrefix ¶
ParsePrefix parses a "nick!user@host" combination (or a prefix) from the given string.
type RegisteredEvent ¶
type RegisteredEvent struct{}
type SASLClient ¶
type SearchEvent ¶
type SearchEvent struct {
Messages []MessageEvent
}
type SelfJoinEvent ¶
type SelfNickEvent ¶
type SelfNickEvent struct {
FormerNick string
}
type SelfPartEvent ¶
type SelfPartEvent struct {
Channel string
}
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession(out chan<- Message, params SessionParams) *Session
func (*Session) ChangeMode ¶
func (*Session) ChangeNick ¶
func (*Session) ChangeTopic ¶
func (*Session) ChannelsSharedWith ¶
func (*Session) HasCapability ¶
HasCapability reports whether the given capability has been negotiated successfully.
func (*Session) MonitorAdd ¶
func (*Session) MonitorRemove ¶
func (*Session) Names ¶
Names returns the list of users in the given target, or nil if the target is not a known channel or nick in the session. The list is sorted according to member name.
func (*Session) NewHistoryRequest ¶
func (s *Session) NewHistoryRequest(target string) *HistoryRequest
func (*Session) TypingStop ¶
func (*Session) TypingStops ¶
type SessionParams ¶
type SessionParams struct { Nickname string Username string RealName string NetID string Auth SASLClient }
SessionParams defines how to connect to an IRC server.
type Severity ¶
type Severity int
Severity is the severity of a server reply.
func ReplySeverity ¶
ReplySeverity returns the severity of a server reply.
type TopicChangeEvent ¶
type Typings ¶
type Typings struct {
// contains filtered or unexported fields
}
Typings keeps track of typing notification timeouts.
func NewTypings ¶
func NewTypings() *Typings
NewTypings initializes the Typings structures and filtering coroutine.
func (*Typings) Close ¶
func (ts *Typings) Close()
Close cleanly closes all channels and stops all goroutines.
type User ¶
type User struct { Name *Prefix // the nick, user and hostname of the user if known. Away bool // whether the user is away or not Disconnected bool // can only be true for monitored users. }
User is a known IRC user.
type UserOfflineEvent ¶
type UserOfflineEvent struct {
User string
}
type UserOnlineEvent ¶
type UserOnlineEvent struct {
User string
}