Merge pull request #38 from spotify/implement-list-templates
Add hardcoded templates response
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user