Skip to content

Commit

Permalink
migration data service in server package
Browse files Browse the repository at this point in the history
Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>
  • Loading branch information
Yashvi Jain authored and Yashvi Jain committed Jan 24, 2022
1 parent 7accc4a commit da193ea
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
19 changes: 11 additions & 8 deletions components/infra-proxy-service/server/migrations.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package server

/*import (
import (
"bytes"
"github.com/chef/automate/api/interservice/infra_proxy/migrations/response"
"github.com/chef/automate/api/interservice/infra_proxy/migrations/service"
uuid "github.com/chef/automate/lib/uuid4"
log "github.com/sirupsen/logrus"
"io"
"os"
"path"
)
Expand All @@ -28,9 +31,9 @@ func saveFile(migrationId string, filename string, fileData bytes.Buffer) error
return nil

}
*/

// UploadFile Takes the stream of data to upload a file
/*func (s *Server) UploadFile(stream service.MigrationDataService_UploadFileServer) error {
func (s *Server) UploadFile(stream service.MigrationDataService_UploadFileServer) error {
in, err := stream.Recv()
if err != io.EOF && err != nil {
return err
Expand Down Expand Up @@ -61,9 +64,9 @@ func saveFile(migrationId string, filename string, fileData bytes.Buffer) error
return err
}

res := &response.UploadFileResponse{
res := &response.UploadZipFileResponse{
MigrationId: migrationId,
Status: "Completed",
Success: true,
}

err = stream.SendAndClose(res)
Expand All @@ -72,13 +75,13 @@ func saveFile(migrationId string, filename string, fileData bytes.Buffer) error
}

return nil
}*/
}

/*func createMigrationId() (string, error) {
func createMigrationId() (string, error) {
uuid, err := uuid.NewV4()
if err != nil {
log.WithError(err).Error("Failed to make a V4 UUID")
return "", err
}
return uuid.String(), nil
}*/
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package migrations

import (
/*import (
"bytes"
uuid "github.com/chef/automate/lib/uuid4"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -92,3 +92,4 @@ func createMigrationId() (string, error) {
}
return uuid.String(), nil
}
*/

0 comments on commit da193ea

Please sign in to comment.