Merge pull request #38 from spotify/implement-list-templates

Add hardcoded templates response
This commit is contained in:
Patrick Balestra
2020-02-05 10:24:28 +01:00
committed by GitHub
2 changed files with 16 additions and 2 deletions
+1 -1
View File
@@ -5,6 +5,6 @@ go 1.13
replace github.com/spotify/backstage/backend/proto => ../proto
require (
github.com/spotify/backstage/backend/proto v0.0.0-00010101000000-000000000000 // indirect
github.com/spotify/backstage/backend/proto v0.0.0-00010101000000-000000000000
google.golang.org/grpc v1.27.0
)
+15 -1
View File
@@ -6,6 +6,7 @@ import (
"net"
pb "github.com/spotify/backstage/backend/proto/scaffolder/v1"
identity "github.com/spotify/backstage/backend/proto/identity/v1"
"google.golang.org/grpc"
)
@@ -30,5 +31,18 @@ type server struct {
}
func (s *server) GetAllTemplates(ctx context.Context, req *pb.Empty) (*pb.GetAllTemplatesResponse, error) {
return &pb.GetAllTemplatesResponse{}, nil
template := &pb.Template {
Id: "react-ssr-template",
Name: "React SSR Template",
User: &identity.User {
Id: "spotify",
Name: "Spotify",
},
}
templates := []*pb.Template{ template }
return &pb.GetAllTemplatesResponse{
Templates: templates,
}, nil
}