blob: ecc51bb39dc37d435d47c7b72b6a9c6abbf223fc (
plain)
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
|
package resetter
import "github.com/spiral/roadrunner/v2/interfaces/log"
type rpc struct {
srv *Plugin
log log.Logger
}
// List all resettable services.
func (rpc *rpc) List(_ bool, list *[]string) error {
rpc.log.Debug("started List method")
*list = make([]string, 0)
for name := range rpc.srv.registry {
*list = append(*list, name)
}
rpc.log.Debug("services list", "services", *list)
rpc.log.Debug("finished List method")
return nil
}
// Reset named service.
func (rpc *rpc) Reset(service string, done *bool) error {
rpc.log.Debug("started Reset method for the service", "service", service)
defer rpc.log.Debug("finished Reset method for the service", "service", service)
*done = true
return rpc.srv.Reset(service)
}
|