summaryrefslogtreecommitdiff
path: root/plugins/status/rpc.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-04-04 18:39:52 +0300
committerValery Piashchynski <[email protected]>2021-04-04 18:39:52 +0300
commitcc56299b877f3fbbae1e3368d98804d06564a424 (patch)
tree6b2bcd13eb32e31cef556f57869b9dcdeea4472a /plugins/status/rpc.go
parentc1664e0815727e599dcb7f7a0a7a95a5be974197 (diff)
- 🔥 Support Readiness checks (via `/ready`) status plugin endpoint.
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/status/rpc.go')
-rw-r--r--plugins/status/rpc.go20
1 files changed, 18 insertions, 2 deletions
diff --git a/plugins/status/rpc.go b/plugins/status/rpc.go
index 396ff451..755a06fa 100644
--- a/plugins/status/rpc.go
+++ b/plugins/status/rpc.go
@@ -14,7 +14,7 @@ type rpc struct {
func (rpc *rpc) Status(service string, status *Status) error {
const op = errors.Op("checker_rpc_status")
rpc.log.Debug("started Status method", "service", service)
- st, err := rpc.srv.Status(service)
+ st, err := rpc.srv.status(service)
if err != nil {
return errors.E(op, err)
}
@@ -22,6 +22,22 @@ func (rpc *rpc) Status(service string, status *Status) error {
*status = st
rpc.log.Debug("status code", "code", st.Code)
- rpc.log.Debug("successfully finished Status method")
+ rpc.log.Debug("successfully finished the Status method")
+ return nil
+}
+
+// Status return current status of the provided plugin
+func (rpc *rpc) Ready(service string, status *Status) error {
+ const op = errors.Op("checker_rpc_ready")
+ rpc.log.Debug("started Ready method", "service", service)
+ st, err := rpc.srv.ready(service)
+ if err != nil {
+ return errors.E(op, err)
+ }
+
+ *status = st
+
+ rpc.log.Debug("status code", "code", st.Code)
+ rpc.log.Debug("successfully finished the Ready method")
return nil
}