forked from skynetservices/skynet-archive
/
logmessages.go
90 lines (69 loc) · 1.84 KB
/
logmessages.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package skynet
import (
"fmt"
)
type DoozerConnected struct {
Addr string
}
func (dc DoozerConnected) String() string {
return fmt.Sprintf("Connected to doozer at %s", dc.Addr)
}
type DoozerDiscovered struct {
DoozerServer *DoozerServer
}
func (dd DoozerDiscovered) String() string {
return fmt.Sprintf("Discovered new doozer %s at %s",
dd.DoozerServer.Key, dd.DoozerServer.Addr)
}
type DoozerRemoved struct {
DoozerServer *DoozerServer
}
func (dr DoozerRemoved) String() string {
return fmt.Sprintf("Removed doozer %s at %s", dr.DoozerServer.Key,
dr.DoozerServer.Addr)
}
type DoozerLostConnection struct {
DoozerConfig *DoozerConfig
}
func (dlc DoozerLostConnection) String() string {
return fmt.Sprintf("Lost connection to doozer at %s", dlc.DoozerConfig.Uri)
}
type MongoConnected struct {
Addr string
}
func (m MongoConnected) String() string {
return fmt.Sprintf("Connected to mongodb at %s", m.Addr)
}
type MongoError struct {
Addr, Err string
}
func (m MongoError) String() string {
return fmt.Sprintf("MongoDB error: %s: %s", m.Addr, m.Err)
}
type LogsearchClient struct {
RemoteAddr, Method, Path string
}
func (l LogsearchClient) String() string {
return fmt.Sprintf("Log Search client attached: %s → %s %s", l.RemoteAddr,
l.Method, l.Path)
}
type ServiceDiscovered struct {
Service *ServiceInfo
}
func (sd ServiceDiscovered) String() string {
return fmt.Sprintf("Discovered service %q at %s", sd.Service.Config.Name,
sd.Service.Config.ServiceAddr)
}
type ServiceRemoved struct {
Service *ServiceInfo
}
func (sr ServiceRemoved) String() string {
return fmt.Sprintf("Removed service %q at %s", sr.Service.Config.Name,
sr.Service.Config.ServiceAddr)
}
type ServiceCreated struct {
ServiceConfig *ServiceConfig
}
func (sc ServiceCreated) String() string {
return fmt.Sprintf("Created service %q", sc.ServiceConfig.Name)
}