diff options
author | Florian Klink <flokli@flokli.de> | 2023-09-22T13·38+0300 |
---|---|---|
committer | flokli <flokli@flokli.de> | 2023-09-22T17·41+0000 |
commit | 732dc68727caa09c2e430fa6822b40ed9b6153f7 (patch) | |
tree | 5b961c859a00eb688b3f25ffb9858777b101e81a /tvix/nar-bridge/pkg/server/narinfo_put.go | |
parent | e13c86d91647bfb0909a7a5eedb9b6d69901dbdd (diff) |
refactor(tvix/nar-bridge): update to new separated protos r/6633
Change-Id: I5eaadc837a4d3a7f635574437127a22de88f556b Reviewed-on: https://cl.tvl.fyi/c/depot/+/9407 Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com> Autosubmit: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/nar-bridge/pkg/server/narinfo_put.go')
-rw-r--r-- | tvix/nar-bridge/pkg/server/narinfo_put.go | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/tvix/nar-bridge/pkg/server/narinfo_put.go b/tvix/nar-bridge/pkg/server/narinfo_put.go index 1ad85d8a8bcb..55543c9bc297 100644 --- a/tvix/nar-bridge/pkg/server/narinfo_put.go +++ b/tvix/nar-bridge/pkg/server/narinfo_put.go @@ -4,6 +4,7 @@ import ( "net/http" "path" + castorev1pb "code.tvl.fyi/tvix/castore/protos" storev1pb "code.tvl.fyi/tvix/store/protos" "github.com/go-chi/chi/v5" "github.com/nix-community/go-nix/pkg/narinfo" @@ -123,10 +124,10 @@ func registerNarinfoPut(s *Server) { // We need to add the basename of the storepath from the .narinfo // to the pathInfo to be sent. switch v := (pathInfo.GetNode().GetNode()).(type) { - case *storev1pb.Node_File: - pathInfoToUpload.Node = &storev1pb.Node{ - Node: &storev1pb.Node_File{ - File: &storev1pb.FileNode{ + case *castorev1pb.Node_File: + pathInfoToUpload.Node = &castorev1pb.Node{ + Node: &castorev1pb.Node_File{ + File: &castorev1pb.FileNode{ Name: []byte(path.Base(narInfo.StorePath)), Digest: v.File.Digest, Size: v.File.Size, @@ -134,19 +135,19 @@ func registerNarinfoPut(s *Server) { }, }, } - case *storev1pb.Node_Symlink: - pathInfoToUpload.Node = &storev1pb.Node{ - Node: &storev1pb.Node_Symlink{ - Symlink: &storev1pb.SymlinkNode{ + case *castorev1pb.Node_Symlink: + pathInfoToUpload.Node = &castorev1pb.Node{ + Node: &castorev1pb.Node_Symlink{ + Symlink: &castorev1pb.SymlinkNode{ Name: []byte(path.Base(narInfo.StorePath)), Target: v.Symlink.Target, }, }, } - case *storev1pb.Node_Directory: - pathInfoToUpload.Node = &storev1pb.Node{ - Node: &storev1pb.Node_Directory{ - Directory: &storev1pb.DirectoryNode{ + case *castorev1pb.Node_Directory: + pathInfoToUpload.Node = &castorev1pb.Node{ + Node: &castorev1pb.Node_Directory{ + Directory: &castorev1pb.DirectoryNode{ Name: []byte(path.Base(narInfo.StorePath)), Digest: v.Directory.Digest, Size: v.Directory.Size, |