This is an automated email from the ASF dual-hosted git repository.

kittohoward pushed a commit to branch statusRPC
in repository https://gitbox.apache.org/repos/asf/incubator-milagro-dta.git

commit b054cd2356bbf88e2c22a44bb95ab6d2a73d959c
Author: howardkitto <[email protected]>
AuthorDate: Fri Sep 13 11:06:25 2019 +0100

    client interface for status page
---
 pkg/api/client.go | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/pkg/api/client.go b/pkg/api/client.go
index 00d336d..fc26acc 100644
--- a/pkg/api/client.go
+++ b/pkg/api/client.go
@@ -22,6 +22,7 @@ package api
 
 import (
        "context"
+       "fmt"
        "net/http"
 
        "github.com/apache/incubator-milagro-dta/libs/logger"
@@ -36,6 +37,7 @@ var (
 type ClientService interface {
        FulfillOrder(req *FulfillOrderRequest) (*FulfillOrderResponse, error)
        FulfillOrderSecret(req *FulfillOrderSecretRequest) 
(*FulfillOrderSecretResponse, error)
+       Status() (*StatusResponse, error)
 }
 
 // MilagroClientService - implements Service Interface
@@ -58,6 +60,11 @@ func ClientEndpoints() transport.HTTPEndpoints {
                        NewRequest:  func() interface{} { return 
&FulfillOrderSecretRequest{} },
                        NewResponse: func() interface{} { return 
&FulfillOrderSecretResponse{} },
                },
+               "Status": {
+                       Path:        "/" + apiVersion + "/status",
+                       Method:      http.MethodGet,
+                       NewResponse: func() interface{} { return 
&StatusResponse{} },
+               },
        }
 }
 
@@ -89,3 +96,16 @@ func (c MilagroClientService) FulfillOrderSecret(req 
*FulfillOrderSecretRequest)
        r := d.(*FulfillOrderSecretResponse)
        return r, nil
 }
+
+//Status - Allows a client to see the status of the server that it is 
connecting too
+func (c MilagroClientService) Status() (*StatusResponse, error) {
+       endpoint := c.endpoints["Status"]
+       
+       s, err := endpoint(context.Background(), nil)
+       if err != nil {
+               return nil, err
+       }
+       r := s.(*StatusResponse)
+       fmt.Println("got status request")
+       return r, nil
+}

Reply via email to