forked from ergochat/ergo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
messages.go
45 lines (36 loc) · 1.03 KB
/
messages.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (c) 2016- Daniel Oaks <daniel@danieloaks.net>
// released under the MIT license
package irc
// Message represents an internal message passed by oragono.
type Message struct {
Type MessageType
Verb MessageVerb
Info map[MessageInfoKey]interface{}
}
// NewMessage returns a new Message.
// This is purely a convenience function.
func NewMessage(mt MessageType, mv MessageVerb) Message {
var message Message
message.Type = mt
message.Verb = mv
message.Info = make(map[MessageInfoKey]interface{})
return message
}
// MessageType represents the type of message it is.
type MessageType int
const (
// LineMT represents an IRC line Message Type
LineMT MessageType = iota
)
// MessageVerb represents the verb (i.e. the specific command, etc) of a message.
type MessageVerb int
const (
// NoMV represents no Message Verb
NoMV MessageVerb = iota
)
// MessageInfoKey represents a key in the Info attribute of a Message.
type MessageInfoKey int
const (
// LineIK represents an IRC line message info key
LineIK MessageInfoKey = iota
)