Documentation ¶
Overview ¶
Package data contains the session data storage system
Package data contains the session data storage system ¶
Package data contains the session data storage system ¶
Package data contains the session data storage system ¶
Package data contains the session data storage system ¶
Package data contains the session data storage system
Index ¶
- Constants
- Variables
- func ChannelExists(network, channel string) bool
- func NetworkExists(name string) bool
- type Channel
- type Highlight
- type HighlightList
- type HighlightMatch
- type Network
- type NotificationLevel
- type RegexHighlight
- type ScriptStore
- func (ss ScriptStore) Delete(net, name string, callback func(net string))
- func (ss ScriptStore) Get(name string) string
- func (ss ScriptStore) Put(net, name, script string, callback func(net string))
- func (ss ScriptStore) Rename(net, oldName, newName string, callback func(net string))
- func (ss ScriptStore) Update(net string, callback func(net string))
- type StringHighlight
Constants ¶
const Version = "2.0.0"
Version of mauIRC
Variables ¶
var ( Networks = make(map[string]*Network) GlobalScripts = make(ScriptStore) MessageFormatting = true )
Base store variables
var ( AuthFail = false Connected = false MessageContainerActive = false )
Misc variables
var ( Socket *websocket.WebSocket SocketPath string Messages = make(chan messages.Container, 16) )
Connection variables
Functions ¶
func ChannelExists ¶
ChannelExists checks if a channel with the given name exists in the network with the given name
func NetworkExists ¶
NetworkExists checks if the network with the given name exists
Types ¶
type Channel ¶
type Channel struct { Userlist []string UserlistPlain []string Topic string TopicSetBy string TopicSetAt int64 Notifications NotificationLevel HistoryFetched bool FetchingHistory bool MessageCache chan messages.Message }
Channel contains channel data
func GetChannel ¶
GetChannel gets the channel with the given name in the network with the given name if they both exist
func MustGetChannel ¶
MustGetChannel gets or creates the channel with the given name in the network with the given name
func (*Channel) SetTopicData ¶
SetTopicData sets all topic-related variables
func (*Channel) SetUserlist ¶
SetUserlist sets the userlist and the plain userlist
type Highlight ¶
type Highlight interface { Match(str string) *HighlightMatch String() string }
Highlight is a highlight
func CreateRegexHighlight ¶
CreateRegexHighlight creates a regex highlight
func CreateStringHighlight ¶
CreateStringHighlight creates a string highlight
type HighlightList ¶
type HighlightList []Highlight
HighlightList is a list of highlights
func (HighlightList) Parse ¶
func (hll HighlightList) Parse(parse string)
Parse highlights from a string
func (HighlightList) String ¶
func (hll HighlightList) String() string
type Network ¶
type Network struct { Channels map[string]*Channel ChannelNames []string Highlights HighlightList Scripts ScriptStore Nick string User string Realname string IP string Port uint16 SSL bool Connected bool }
Network contains network data
func GetNetwork ¶
GetNetwork the network with the given name if it exists
func MustGetNetwork ¶
MustGetNetwork gets or creates the network with the given name
func (*Network) ChannelExists ¶
ChannelExists checks if the channel with the given name exists
func (*Network) GetChannel ¶
GetChannel the channel with the given name if it exists
func (*Network) MustGetChannel ¶
MustGetChannel gets or creates the channel with the given name
type NotificationLevel ¶
type NotificationLevel int
NotificationLevel tells what messages should the user get notified about
const ( NotificationNone NotificationLevel = 0 NotificationHighlights NotificationLevel = 1 NotificationAll NotificationLevel = 2 )
Values for NotificationLevel
func ParseNotificationLevel ¶
func ParseNotificationLevel(str string) NotificationLevel
ParseNotificationLevel parses a notification level from a string
func (NotificationLevel) String ¶
func (nl NotificationLevel) String() string
type RegexHighlight ¶
type RegexHighlight struct {
// contains filtered or unexported fields
}
RegexHighlight is a highlight type that checks for matches with regex
func (RegexHighlight) Match ¶
func (hl RegexHighlight) Match(str string) *HighlightMatch
Match gets all the regex matches
func (RegexHighlight) String ¶
func (hl RegexHighlight) String() string
String turns this into a string
type ScriptStore ¶
ScriptStore contains functions common to stores that have a script unit
func (ScriptStore) Delete ¶
func (ss ScriptStore) Delete(net, name string, callback func(net string))
Delete the script with the given name
func (ScriptStore) Get ¶
func (ss ScriptStore) Get(name string) string
Get the script with the given name
func (ScriptStore) Put ¶
func (ss ScriptStore) Put(net, name, script string, callback func(net string))
Put the given script under the given name
func (ScriptStore) Rename ¶
func (ss ScriptStore) Rename(net, oldName, newName string, callback func(net string))
Rename the script with the given name
func (ScriptStore) Update ¶
func (ss ScriptStore) Update(net string, callback func(net string))
Update scripts from server
type StringHighlight ¶
type StringHighlight struct {
// contains filtered or unexported fields
}
StringHighlight is a highlight type that checks for case-insensitive string matches
func (StringHighlight) Match ¶
func (hl StringHighlight) Match(str string) *HighlightMatch
Match gets all the case-insensitive string matches