Skip to content

Commit

Permalink
add GetHome call (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
labkode committed Nov 8, 2019
1 parent ac1b961 commit 1ea3e09
Show file tree
Hide file tree
Showing 5 changed files with 179 additions and 116 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/aws/aws-sdk-go v1.25.27
github.com/cheggaaa/pb v1.0.28
github.com/coreos/go-oidc v2.1.0+incompatible
github.com/cs3org/go-cs3apis v0.0.0-20191015062230-f4cde4c589eb
github.com/cs3org/go-cs3apis v0.0.0-20191108224558-365d440ba78a
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/fatih/color v1.7.0 // indirect
github.com/go-openapi/strfmt v0.19.2 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
github.com/coreos/go-oidc v2.1.0+incompatible h1:sdJrfw8akMnCuUlaZU3tE/uYXFgfqom8DBE9so9EBsM=
github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/cs3org/go-cs3apis v0.0.0-20191015062230-f4cde4c589eb h1:1/emyd/qbeGElCYoADO02JekYnVbT8rHpWnTT/Ewlzk=
github.com/cs3org/go-cs3apis v0.0.0-20191015062230-f4cde4c589eb/go.mod h1:+SahswLd+p4bLlXXG+UuNiWSgRin4dSQQOgPXCsdiTM=
github.com/cs3org/go-cs3apis v0.0.0-20191108224558-365d440ba78a h1:VAtkhkCSQpNU+Vvw0ZpBv5s08rQHFlzMt6AhKuhxbSY=
github.com/cs3org/go-cs3apis v0.0.0-20191108224558-365d440ba78a/go.mod h1:vA2ohA0bZacDI5E0K/EgnVKybTGHPD/fGncABMAjOzI=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
16 changes: 16 additions & 0 deletions internal/grpc/services/gateway/storageprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,22 @@ func (s *svc) sign(ctx context.Context, target string) (string, error) {
return tkn, nil
}

func (s *svc) GetHome(ctx context.Context, ref *storageregistryv0alphapb.GetHomeRequest) (*storageregistryv0alphapb.GetHomeResponse, error) {
c, err := pool.GetStorageRegistryClient(s.c.StorageRegistryEndpoint)
if err != nil {
err = errors.Wrap(err, "gateway: error getting storage registry client")
return nil, err
}

res, err := c.GetHome(ctx, &storageregistryv0alphapb.GetHomeRequest{})

if err != nil {
err = errors.Wrap(err, "gateway: error calling GetHome")
return nil, err
}
return res, nil
}

func (s *svc) InitiateFileDownload(ctx context.Context, req *storageproviderv0alphapb.InitiateFileDownloadRequest) (*gatewayv0alphapb.InitiateFileDownloadResponse, error) {
c, err := s.find(ctx, req.Ref)
if err != nil {
Expand Down

0 comments on commit 1ea3e09

Please sign in to comment.