-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.go
More file actions
92 lines (78 loc) · 2.58 KB
/
client.go
File metadata and controls
92 lines (78 loc) · 2.58 KB
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
91
92
package edgecenterrmon
import (
"github.com/Edge-Center/edgecenteredgemon-go/channel"
"github.com/Edge-Center/edgecenteredgemon-go/checkgroup"
"github.com/Edge-Center/edgecenteredgemon-go/checks/checkdns"
"github.com/Edge-Center/edgecenteredgemon-go/checks/checkhttp"
"github.com/Edge-Center/edgecenteredgemon-go/checks/checkping"
"github.com/Edge-Center/edgecenteredgemon-go/checks/checkrabbitmq"
"github.com/Edge-Center/edgecenteredgemon-go/checks/checksmtp"
"github.com/Edge-Center/edgecenteredgemon-go/checks/checktcp"
"github.com/Edge-Center/edgecenteredgemon-go/edgecenter"
"github.com/Edge-Center/edgecenteredgemon-go/statuspage"
)
type ClientService interface {
Channel() channel.Service
StatusPage() statuspage.Service
CheckGroup() checkgroup.Service
CheckDNS() checkdns.Service
CheckHTTP() checkhttp.Service
CheckPing() checkping.Service
CheckRabbitMQ() checkrabbitmq.Service
CheckSMTP() checksmtp.Service
CheckTCP() checktcp.Service
}
var _ ClientService = (*Service)(nil)
type Service struct {
r edgecenter.Requester
channelService channel.Service
statusPageService statuspage.Service
checkGroupService checkgroup.Service
checkDNSService checkdns.Service
checkHTTPService checkhttp.Service
checkPingService checkping.Service
checkRabbitMQService checkrabbitmq.Service
checkSMTPService checksmtp.Service
checkTCPService checktcp.Service
}
func NewService(r edgecenter.Requester) *Service {
return &Service{
r: r,
channelService: channel.New(r),
statusPageService: statuspage.New(r),
checkGroupService: checkgroup.New(r),
checkDNSService: checkdns.New(r),
checkHTTPService: checkhttp.New(r),
checkPingService: checkping.New(r),
checkRabbitMQService: checkrabbitmq.New(r),
checkSMTPService: checksmtp.New(r),
checkTCPService: checktcp.New(r),
}
}
func (s *Service) Channel() channel.Service {
return s.channelService
}
func (s *Service) StatusPage() statuspage.Service {
return s.statusPageService
}
func (s *Service) CheckGroup() checkgroup.Service {
return s.checkGroupService
}
func (s *Service) CheckDNS() checkdns.Service {
return s.checkDNSService
}
func (s *Service) CheckHTTP() checkhttp.Service {
return s.checkHTTPService
}
func (s *Service) CheckPing() checkping.Service {
return s.checkPingService
}
func (s *Service) CheckRabbitMQ() checkrabbitmq.Service {
return s.checkRabbitMQService
}
func (s *Service) CheckSMTP() checksmtp.Service {
return s.checkSMTPService
}
func (s *Service) CheckTCP() checktcp.Service {
return s.checkTCPService
}