message.go (279B)
1 package event 2 3 import "time" 4 5 type Message struct { 6 t time.Time 7 text string 8 } 9 10 func (e *Message) Time() time.Time { 11 return e.t 12 } 13 14 func (e *Message) Text() string { 15 return e.text 16 } 17 18 func NewMessage(s string) *Message { 19 return &Message{ 20 t: time.Now(), 21 text: s, 22 } 23 }