Skip to content

Commit

Permalink
Support grpc:// scheme for registry
Browse files Browse the repository at this point in the history
  • Loading branch information
k1LoW committed Oct 13, 2023
1 parent 75aab3f commit b3da46c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dewy.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ import (
"github.com/linyows/dewy/notice"
"github.com/linyows/dewy/registry"
ghrelease "github.com/linyows/dewy/registry/github_release"
grpcr "github.com/linyows/dewy/registry/grpc"
"github.com/linyows/dewy/storage"
"google.golang.org/grpc"
)

const (
Expand Down Expand Up @@ -326,6 +328,14 @@ func newRegistry(urlstr string, preRelease bool, artifactName string) (registry.
PreRelease: preRelease,
}
return ghrelease.New(c)
case grpcr.Scheme:
// TODO: handle tls
target := su[1]
cc, err := grpc.Dial(target)
if err != nil {
return nil, err
}
return grpcr.New(cc)
}
return nil, fmt.Errorf("unsupported registry: %s", urlstr)
}

0 comments on commit b3da46c

Please sign in to comment.