forked from osuripple/hanayo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
messages.go
41 lines (30 loc) · 853 Bytes
/
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
package main
type message interface {
Type() string
Content() string
}
type errorMessage struct {
C string
}
func (errorMessage) Type() string { return "error" }
func (m errorMessage) Content() string { return m.C }
type neutralMessage struct {
C string
}
func (neutralMessage) Type() string { return "" }
func (m neutralMessage) Content() string { return m.C }
type infoMessage struct {
C string
}
func (infoMessage) Type() string { return "info" }
func (m infoMessage) Content() string { return m.C }
type successMessage struct {
C string
}
func (successMessage) Type() string { return "positive" }
func (m successMessage) Content() string { return m.C }
type warningMessage struct {
C string
}
func (warningMessage) Type() string { return "warning" }
func (m warningMessage) Content() string { return m.C }