feat: updated grpc gateway related code

This commit is contained in:
Andrey Melnikov
2020-12-17 14:09:20 -08:00
parent 2a01138cf3
commit d99189807d
42 changed files with 12143 additions and 419 deletions

View File

@@ -9,6 +9,7 @@ import (
"github.com/onepanelio/core/pkg/util/request/pagination"
"github.com/onepanelio/core/pkg/util/router"
"github.com/onepanelio/core/server/converter"
log "github.com/sirupsen/logrus"
"google.golang.org/grpc/codes"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sort"
@@ -24,7 +25,9 @@ import (
requestSort "github.com/onepanelio/core/pkg/util/request/sort"
)
type WorkflowServer struct{}
type WorkflowServer struct {
api.UnimplementedWorkflowServiceServer
}
func NewWorkflowServer() *WorkflowServer {
return &WorkflowServer{}
@@ -217,6 +220,7 @@ func (s *WorkflowServer) WatchWorkflowExecution(req *api.WatchWorkflowExecutionR
}
wf.Namespace = req.Namespace
if err := stream.Send(apiWorkflowExecution(wf, webRouter)); err != nil {
log.Printf("Stream Send failed: %v\n", err)
return err
}
}