|
|
@@ -9,18 +9,18 @@ import (
|
|
|
// GRPCClient is an implementation of CustomCostsSource that talks over RPC.
|
|
|
type GRPCClient struct{ client pb.CustomCostsSourceClient }
|
|
|
|
|
|
-func (m *GRPCClient) GetCustomCosts(req pb.CustomCostRequest) []pb.CustomCostResponse {
|
|
|
- resp, err := m.client.GetCustomCosts(context.Background(), &req)
|
|
|
+func (m *GRPCClient) GetCustomCosts(req *pb.CustomCostRequest) []*pb.CustomCostResponse {
|
|
|
+ resp, err := m.client.GetCustomCosts(context.Background(), req)
|
|
|
if err != nil {
|
|
|
- return []pb.CustomCostResponse{
|
|
|
+ return []*pb.CustomCostResponse{
|
|
|
{
|
|
|
Errors: []string{err.Error()},
|
|
|
},
|
|
|
}
|
|
|
}
|
|
|
- derefs := []pb.CustomCostResponse{}
|
|
|
+ derefs := []*pb.CustomCostResponse{}
|
|
|
for _, resp := range resp.Resps {
|
|
|
- derefs = append(derefs, *resp)
|
|
|
+ derefs = append(derefs, resp)
|
|
|
}
|
|
|
return derefs
|
|
|
}
|
|
|
@@ -36,9 +36,9 @@ func (m *GRPCServer) GetCustomCosts(
|
|
|
ctx context.Context,
|
|
|
req *pb.CustomCostRequest) (*pb.CustomCostResponseSet, error) {
|
|
|
ptrs := []*pb.CustomCostResponse{}
|
|
|
- costs := m.Impl.GetCustomCosts(*req)
|
|
|
+ costs := m.Impl.GetCustomCosts(req)
|
|
|
for _, cost := range costs {
|
|
|
- ptrs = append(ptrs, &cost)
|
|
|
+ ptrs = append(ptrs, cost)
|
|
|
}
|
|
|
return &pb.CustomCostResponseSet{
|
|
|
Resps: ptrs,
|