Documentation ¶
Index ¶
- Variables
- func NewTracker(mynick string) *stateTracker
- type ChanMode
- type ChanPrivs
- type Channel
- type MockTracker
- func (_m *MockTracker) Associate(channel string, nick string) *ChanPrivs
- func (_m *MockTracker) ChannelModes(channel string, modestr string, modeargs ...string) *Channel
- func (_m *MockTracker) DelChannel(channel string) *Channel
- func (_m *MockTracker) DelNick(nick string) *Nick
- func (_m *MockTracker) Dissociate(channel string, nick string)
- func (_m *MockTracker) EXPECT() *_MockTrackerRecorder
- func (_m *MockTracker) GetChannel(channel string) *Channel
- func (_m *MockTracker) GetNick(nick string) *Nick
- func (_m *MockTracker) IsOn(channel string, nick string) (*ChanPrivs, bool)
- func (_m *MockTracker) Me() *Nick
- func (_m *MockTracker) NewChannel(channel string) *Channel
- func (_m *MockTracker) NewNick(nick string) *Nick
- func (_m *MockTracker) NickInfo(nick string, ident string, host string, name string) *Nick
- func (_m *MockTracker) NickModes(nick string, modestr string) *Nick
- func (_m *MockTracker) ReNick(old string, neu string) *Nick
- func (_m *MockTracker) String() string
- func (_m *MockTracker) Topic(channel string, topic string) *Channel
- func (_m *MockTracker) Wipe()
- type Nick
- type NickMode
- type Tracker
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 ¶
A Channel is returned from the state tracker and contains a copy of the channel state at a particular time.
type MockTracker ¶
type MockTracker struct {
// contains filtered or unexported fields
}
Mock of Tracker interface
func NewMockTracker ¶
func NewMockTracker(ctrl *gomock.Controller) *MockTracker
func (*MockTracker) Associate ¶
func (_m *MockTracker) Associate(channel string, nick string) *ChanPrivs
func (*MockTracker) ChannelModes ¶
func (_m *MockTracker) ChannelModes(channel string, modestr string, modeargs ...string) *Channel
func (*MockTracker) DelChannel ¶
func (_m *MockTracker) DelChannel(channel string) *Channel
func (*MockTracker) DelNick ¶
func (_m *MockTracker) DelNick(nick string) *Nick
func (*MockTracker) Dissociate ¶
func (_m *MockTracker) Dissociate(channel string, nick string)
func (*MockTracker) EXPECT ¶
func (_m *MockTracker) EXPECT() *_MockTrackerRecorder
func (*MockTracker) GetChannel ¶
func (_m *MockTracker) GetChannel(channel string) *Channel
func (*MockTracker) GetNick ¶
func (_m *MockTracker) GetNick(nick string) *Nick
func (*MockTracker) IsOn ¶
func (_m *MockTracker) IsOn(channel string, nick string) (*ChanPrivs, bool)
func (*MockTracker) Me ¶
func (_m *MockTracker) Me() *Nick
func (*MockTracker) NewChannel ¶
func (_m *MockTracker) NewChannel(channel string) *Channel
func (*MockTracker) NewNick ¶
func (_m *MockTracker) NewNick(nick string) *Nick
func (*MockTracker) String ¶
func (_m *MockTracker) String() string
func (*MockTracker) Wipe ¶
func (_m *MockTracker) Wipe()
type Nick ¶
A Nick is returned from the state tracker and contains a copy of the nick state at a particular time.
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 Tracker ¶
type Tracker interface { // Nick methods NewNick(nick string) *Nick GetNick(nick string) *Nick ReNick(old, neu string) *Nick DelNick(nick string) *Nick NickInfo(nick, ident, host, name string) *Nick NickModes(nick, modestr string) *Nick // Channel methods NewChannel(channel string) *Channel GetChannel(channel string) *Channel DelChannel(channel string) *Channel Topic(channel, topic string) *Channel ChannelModes(channel, modestr string, modeargs ...string) *Channel // Information about ME! Me() *Nick // And the tracking operations IsOn(channel, nick string) (*ChanPrivs, bool) Associate(channel, nick string) *ChanPrivs Dissociate(channel, nick string) Wipe() // The state tracker can output a debugging string String() string }
The state manager interface