Documentation ¶
Index ¶
- Variables
- func NewTracker(mynick string) *stateTracker
- type ChanMode
- type ChanPrivs
- type Channel
- type MockStateTracker
- func (_m *MockStateTracker) Associate(channel *Channel, nick *Nick) *ChanPrivs
- func (_m *MockStateTracker) DelChannel(channel string)
- func (_m *MockStateTracker) DelNick(nick string)
- func (_m *MockStateTracker) Dissociate(channel *Channel, nick *Nick)
- func (_m *MockStateTracker) EXPECT() *_MockStateTrackerRecorder
- func (_m *MockStateTracker) GetChannel(channel string) *Channel
- func (_m *MockStateTracker) GetNick(nick string) *Nick
- func (_m *MockStateTracker) IsOn(channel string, nick string) (*ChanPrivs, bool)
- func (_m *MockStateTracker) Me() *Nick
- func (_m *MockStateTracker) NewChannel(channel string) *Channel
- func (_m *MockStateTracker) NewNick(nick string) *Nick
- func (_m *MockStateTracker) ReNick(old string, neu string)
- func (_m *MockStateTracker) String() string
- func (_m *MockStateTracker) Wipe()
- type Nick
- type NickMode
- type StateTracker
Constants ¶
This section is empty.
Variables ¶
var ChanModeToString = map[string]string{
"Private": "p",
"Secret": "s",
"ProtectedTopic": "t",
"NoExternalMsg": "n",
"Moderated": "m",
"InviteOnly": "i",
"OperOnly": "O",
"SSLOnly": "z",
"Registered": "r",
"AllSSL": "Z",
"Key": "k",
"Limit": "l",
}
var ChanPrivToModeChar = map[string]byte{
"Owner": '~',
"Admin": '&',
"Op": '@',
"HalfOp": '%',
"Voice": '+',
}
var ChanPrivToString = map[string]string{
"Owner": "q",
"Admin": "a",
"Op": "o",
"HalfOp": "h",
"Voice": "v",
}
var ModeCharToChanPriv = map[byte]string{}
Map *irc.ChanPrivs fields to the symbols used to represent these modes in NAMES and WHOIS responses
var NickModeToString = map[string]string{
"Bot": "B",
"Invisible": "i",
"Oper": "o",
"WallOps": "w",
"HiddenHost": "x",
"SSL": "z",
}
var StringToChanMode = map[string]string{}
Map ChanMode fields to IRC mode characters
var StringToChanPriv = map[string]string{}
Map *irc.ChanPrivs fields to IRC mode characters
var StringToNickMode = map[string]string{}
Map *irc.NickMode fields to IRC mode characters and vice versa
Functions ¶
Types ¶
type ChanMode ¶
type ChanMode struct {
// MODE +p, +s, +t, +n, +m
Private, Secret, ProtectedTopic, NoExternalMsg, Moderated bool
// MODE +i, +O, +z
InviteOnly, OperOnly, SSLOnly bool
// MODE +r, +Z
Registered, AllSSL bool
// MODE +k
Key string
// MODE +l
Limit int
}
A struct representing the modes of an IRC Channel (the ones we care about, at least). http://www.unrealircd.com/files/docs/unreal32docs.html#userchannelmodes
type ChanPrivs ¶
type ChanPrivs struct {
// MODE +q, +a, +o, +h, +v
Owner, Admin, Op, HalfOp, Voice bool
}
A struct representing the modes a Nick can have on a Channel
type Channel ¶
type Channel struct {
Name, Topic string
Modes *ChanMode
// contains filtered or unexported fields
}
A struct representing an IRC channel
func NewChannel ¶
func (*Channel) ParseModes ¶
Parses mode strings for a channel.
type MockStateTracker ¶
type MockStateTracker struct {
// contains filtered or unexported fields
}
Mock of StateTracker interface
func NewMockStateTracker ¶
func NewMockStateTracker(ctrl *gomock.Controller) *MockStateTracker
func (*MockStateTracker) Associate ¶
func (_m *MockStateTracker) Associate(channel *Channel, nick *Nick) *ChanPrivs
func (*MockStateTracker) DelChannel ¶
func (_m *MockStateTracker) DelChannel(channel string)
func (*MockStateTracker) DelNick ¶
func (_m *MockStateTracker) DelNick(nick string)
func (*MockStateTracker) Dissociate ¶
func (_m *MockStateTracker) Dissociate(channel *Channel, nick *Nick)
func (*MockStateTracker) EXPECT ¶
func (_m *MockStateTracker) EXPECT() *_MockStateTrackerRecorder
func (*MockStateTracker) GetChannel ¶
func (_m *MockStateTracker) GetChannel(channel string) *Channel
func (*MockStateTracker) GetNick ¶
func (_m *MockStateTracker) GetNick(nick string) *Nick
func (*MockStateTracker) IsOn ¶
func (_m *MockStateTracker) IsOn(channel string, nick string) (*ChanPrivs, bool)
func (*MockStateTracker) Me ¶
func (_m *MockStateTracker) Me() *Nick
func (*MockStateTracker) NewChannel ¶
func (_m *MockStateTracker) NewChannel(channel string) *Channel
func (*MockStateTracker) NewNick ¶
func (_m *MockStateTracker) NewNick(nick string) *Nick
func (*MockStateTracker) ReNick ¶
func (_m *MockStateTracker) ReNick(old string, neu string)
func (*MockStateTracker) String ¶
func (_m *MockStateTracker) String() string
func (*MockStateTracker) Wipe ¶
func (_m *MockStateTracker) Wipe()
type Nick ¶
type Nick struct {
Nick, Ident, Host, Name string
Modes *NickMode
// contains filtered or unexported fields
}
A struct representing an IRC nick
func (*Nick) ChannelsStr ¶
ChannelsStr returns a list of channel strings the nick is on.
type NickMode ¶
type NickMode struct {
// MODE +B, +i, +o, +w, +x, +z
Bot, Invisible, Oper, WallOps, HiddenHost, SSL bool
}
A struct representing the modes of an IRC Nick (User Modes) (again, only the ones we care about)
This is only really useful for me, as we can't see other people's modes without IRC operator privileges (and even then only on some IRCd's).
type StateTracker ¶
type StateTracker interface { // Nick methods NewNick(nick string) *Nick GetNick(nick string) *Nick ReNick(old, neu string) DelNick(nick string) // Channel methods NewChannel(channel string) *Channel GetChannel(channel string) *Channel DelChannel(channel string) // Information about ME! Me() *Nick // And the tracking operations IsOn(channel, nick string) (*ChanPrivs, bool) Associate(channel *Channel, nick *Nick) *ChanPrivs Dissociate(channel *Channel, nick *Nick) Wipe() // The state tracker can output a debugging string String() string }
The state manager interface