Documentation
¶
Overview ¶
Package ircstate maintains channel, user, and mode state for one connection from the parsed message stream, exposing value snapshots.
Index ¶
- type ChannelView
- type MemberView
- type ModeView
- type Tracker
- func (t *Tracker) ApplyISupport(token string)
- func (t *Tracker) ApplyMessage(m ircmsg.Message)
- func (t *Tracker) CapValue(name string) (string, bool)
- func (t *Tracker) Caps() []string
- func (t *Tracker) Channel(name string) (ChannelView, bool)
- func (t *Tracker) Channels() []ChannelView
- func (t *Tracker) HasCap(name string) bool
- func (t *Tracker) ISupport() ircsupport.ISupportView
- func (t *Tracker) Reset()
- func (t *Tracker) Self() string
- func (t *Tracker) SetCap(name, value string, enabled bool)
- func (t *Tracker) SetSelf(nick string)
- func (t *Tracker) User(nick string) (UserView, bool)
- type UserView
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelView ¶
type ChannelView struct {
Name string
Topic string
TopicSetBy string
TopicSetAt time.Time
Modes []ModeView
ListModes map[rune][]string
Created time.Time
Members []MemberView
JoinedAt time.Time
}
ChannelView is a value snapshot of one channel's state.
type MemberView ¶
type MemberView struct {
Nick string
Account string
User string
Host string
Prefixes []rune
Away bool
Bot bool
}
MemberView is a value snapshot of one channel member.
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker holds channel, user, and mode state for one connection, guarded by a single mutex.
func (*Tracker) ApplyISupport ¶
ApplyISupport ingests one 005 ISUPPORT token.
func (*Tracker) ApplyMessage ¶
ApplyMessage updates state from one parsed line.
func (*Tracker) CapValue ¶
CapValue returns a capability's negotiated value and whether it is enabled.
func (*Tracker) Channel ¶
func (t *Tracker) Channel(name string) (ChannelView, bool)
Channel returns a snapshot of the named channel and whether it is tracked.
func (*Tracker) Channels ¶
func (t *Tracker) Channels() []ChannelView
Channels returns snapshots of all tracked channels.
func (*Tracker) ISupport ¶
func (t *Tracker) ISupport() ircsupport.ISupportView
ISupport returns the read-only ISUPPORT view.
func (*Tracker) Reset ¶
func (t *Tracker) Reset()
Reset drops all per-connection state and returns ISUPPORT to defaults.