From 40a9a942447fe9721a0beef0d9e3e422ef70a10f Mon Sep 17 00:00:00 2001 From: Minh Doan Date: Wed, 30 Jan 2019 14:23:51 -0800 Subject: [PATCH] change service interface for services --- api/services/explorer/service.go | 8 ++++---- node/service/support_client.go | 8 ++++---- node/service_test.go | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/api/services/explorer/service.go b/api/services/explorer/service.go index d393a7f52..5aec132dd 100644 --- a/api/services/explorer/service.go +++ b/api/services/explorer/service.go @@ -38,15 +38,15 @@ func New(selfPeer *p2p.Peer) *Service { } } -// Start starts explorer service. -func (s *Service) Start() { +// StartService starts explorer service. +func (s *Service) StartService() { utils.GetLogInstance().Info("Starting explorer service.") s.Init(true) s.server = s.Run() } -// Stop shutdowns explorer service. -func (s *Service) Stop() { +// StopService shutdowns explorer service. +func (s *Service) StopService() { utils.GetLogInstance().Info("Shutting down explorer service.") if err := s.server.Shutdown(context.Background()); err != nil { utils.GetLogInstance().Error("Error when shutting down explorer server", "error", err) diff --git a/node/service/support_client.go b/node/service/support_client.go index a82bc21f1..6c48a881c 100644 --- a/node/service/support_client.go +++ b/node/service/support_client.go @@ -28,12 +28,12 @@ func NewSupportClient(stateReader func() (*state.DB, error), callFaucetContract return &SupportClient{server: clientService.NewServer(stateReader, callFaucetContract), ip: ip, port: strconv.Itoa(port + ClientServicePortDiff)} } -// Start ... -func (sc *SupportClient) Start() { +// StartService ... +func (sc *SupportClient) StartService() { sc.grpcServer, _ = sc.server.Start(sc.ip, sc.port) } -// Stop ... -func (sc *SupportClient) Stop() { +// StopService ... +func (sc *SupportClient) StopService() { sc.grpcServer.Stop() } diff --git a/node/service_test.go b/node/service_test.go index dce176e19..96ce80f1f 100644 --- a/node/service_test.go +++ b/node/service_test.go @@ -8,11 +8,11 @@ import ( type SupportSyncingTest struct{} -func (s *SupportSyncingTest) Start() { +func (s *SupportSyncingTest) StartService() { fmt.Println("SupportSyncingTest starting") } -func (s *SupportSyncingTest) Stop() { +func (s *SupportSyncingTest) StopService() { fmt.Println("SupportSyncingTest stopping") }